
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module Histograms</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">

<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>Histograms</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:///C:/lp1415-5958-3958/src/histograms.py">c:\lp1415-5958-3958\src\histograms.py</a></font></td></tr></table>
    <p><tt>Tema&nbsp;-&nbsp;Linguagens&nbsp;de&nbsp;Programação&nbsp;Dinâmicas<br>
Trabalho&nbsp;de&nbsp;Python&nbsp;á&nbsp;Discíplina&nbsp;-&nbsp;Linguagens&nbsp;de&nbsp;Programação<br>
&nbsp;<br>
Histograms.py,&nbsp;tem&nbsp;como&nbsp;função&nbsp;efectuar&nbsp;histogramas&nbsp;estatisticos&nbsp;&nbsp;<br>
Depois&nbsp;de&nbsp;efectuar&nbsp;a&nbsp;leitura&nbsp;dos&nbsp;dados,&nbsp;vindos&nbsp;da&nbsp;Banco&nbsp;de&nbsp;Dados,&nbsp;o&nbsp;objetivo&nbsp;do&nbsp;Histograms&nbsp;é&nbsp;&nbsp;<br>
efetuar&nbsp;uma&nbsp;interface&nbsp;gráfica&nbsp;neste&nbsp;caso&nbsp;histogramas&nbsp;simples&nbsp;e&nbsp;compostos&nbsp;representando&nbsp;assim&nbsp;as&nbsp;estatisticas&nbsp;dos&nbsp;dados&nbsp;pedidos.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
    
<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="FixTk.html">FixTk</a><br>
<a href="ReadFile.html">ReadFile</a><br>
<a href="Reports.html">Reports</a><br>
<a href="Tkinter.html">Tkinter</a><br>
<a href="numpy.add_newdocs.html">numpy.add_newdocs</a><br>
<a href="matplotlib.cbook.html">matplotlib.cbook</a><br>
<a href="numpy.core.defchararray.html">numpy.core.defchararray</a><br>
<a href="matplotlib.cm.html">matplotlib.cm</a><br>
<a href="collections.html">collections</a><br>
<a href="numpy.ctypeslib.html">numpy.ctypeslib</a><br>
<a href="datetime.html">datetime</a><br>
</td><td width="25%" valign=top><a href="matplotlib.docstring.html">matplotlib.docstring</a><br>
<a href="numpy.lib.scimath.html">numpy.lib.scimath</a><br>
<a href="numpy.fft.fftpack.html">numpy.fft.fftpack</a><br>
<a href="numpy.fft.fftpack_lite.html">numpy.fft.fftpack_lite</a><br>
<a href="functools.html">functools</a><br>
<a href="numpy.fft.helper.html">numpy.fft.helper</a><br>
<a href="numpy.linalg.info.html">numpy.linalg.info</a><br>
<a href="numpy.linalg.lapack_lite.html">numpy.linalg.lapack_lite</a><br>
<a href="numpy.linalg.linalg.html">numpy.linalg.linalg</a><br>
<a href="numpy.ma.html">numpy.ma</a><br>
<a href="math.html">math</a><br>
</td><td width="25%" valign=top><a href="matplotlib.html">matplotlib</a><br>
<a href="matplotlib.mlab.html">matplotlib.mlab</a><br>
<a href="matplotlib.html">matplotlib</a><br>
<a href="numpy.html">numpy</a><br>
<a href="os.html">os</a><br>
<a href="matplotlib.pyplot.html">matplotlib.pyplot</a><br>
<a href="matplotlib.pyplot.html">matplotlib.pyplot</a><br>
<a href="re.html">re</a><br>
<a href="numpy.core.records.html">numpy.core.records</a><br>
<a href="six.html">six</a><br>
<a href="sqlalchemy.html">sqlalchemy</a><br>
</td><td width="25%" valign=top><a href="matplotlib.style.html">matplotlib.style</a><br>
<a href="sys.html">sys</a><br>
<a href="time.html">time</a><br>
<a href="tkFileDialog.html">tkFileDialog</a><br>
<a href="tkMessageBox.html">tkMessageBox</a><br>
<a href="_tkinter.html">_tkinter</a><br>
<a href="warnings.html">warnings</a><br>
<a href="xlrd.html">xlrd</a><br>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
    
<tr><td bgcolor="#eeaa77"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><dl><dt><a name="-HistogramDisposableRemuneration"><strong>HistogramDisposableRemuneration</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Rendimento&nbsp;disponivel&nbsp;anual&nbsp;bruto&nbsp;per&nbsp;capita</tt></dd></dl>
 <dl><dt><a name="-HistogramIPC"><strong>HistogramIPC</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Índice&nbsp;de&nbsp;Precos&nbsp;ao&nbsp;consumidor&nbsp;(IPC)</tt></dd></dl>
 <dl><dt><a name="-HistogramInflation"><strong>HistogramInflation</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Taxa&nbsp;de&nbsp;Inflação</tt></dd></dl>
 <dl><dt><a name="-HistogramMaximumRemuneration"><strong>HistogramMaximumRemuneration</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Remuneracao&nbsp;maxima&nbsp;mensal&nbsp;dos&nbsp;funcionarios&nbsp;publicos</tt></dd></dl>
 <dl><dt><a name="-HistogramMinimumMaximumRemuneration"><strong>HistogramMinimumMaximumRemuneration</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Remuneracao&nbsp;maxima&nbsp;mensal&nbsp;dos&nbsp;funcionarios&nbsp;publicos</tt></dd></dl>
 <dl><dt><a name="-HistogramMinimumRemuneration"><strong>HistogramMinimumRemuneration</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Taxa&nbsp;de&nbsp;Inflação</tt></dd></dl>
 <dl><dt><a name="-HistogramNationalRemuneration"><strong>HistogramNationalRemuneration</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Rendimento&nbsp;nacional&nbsp;anual&nbsp;bruto&nbsp;per&nbsp;capita</tt></dd></dl>
 <dl><dt><a name="-HistogramPIB"><strong>HistogramPIB</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Produto&nbsp;Interno&nbsp;Bruto&nbsp;Anual&nbsp;(PIB)&nbsp;per&nbsp;capita</tt></dd></dl>
 <dl><dt><a name="-HistogramPerCapitaAnnualRemuneration"><strong>HistogramPerCapitaAnnualRemuneration</strong></a>(self)</dt><dd><tt>Função&nbsp;responsável&nbsp;por&nbsp;criar&nbsp;o&nbsp;histograma&nbsp;de&nbsp;Remuneracoes&nbsp;per&nbsp;capita&nbsp;anuais</tt></dd></dl>
 <dl><dt><a name="-add_docstring"><strong>add_docstring</strong></a>(...)</dt><dd><tt><a href="#-add_docstring">add_docstring</a>(obj,&nbsp;docstring)<br>
&nbsp;<br>
Add&nbsp;a&nbsp;docstring&nbsp;to&nbsp;a&nbsp;built-in&nbsp;obj&nbsp;if&nbsp;possible.<br>
If&nbsp;the&nbsp;obj&nbsp;already&nbsp;has&nbsp;a&nbsp;docstring&nbsp;raise&nbsp;a&nbsp;RuntimeError<br>
If&nbsp;this&nbsp;routine&nbsp;does&nbsp;not&nbsp;know&nbsp;how&nbsp;to&nbsp;add&nbsp;a&nbsp;docstring&nbsp;to&nbsp;the&nbsp;object<br>
raise&nbsp;a&nbsp;TypeError</tt></dd></dl>
 <dl><dt><a name="-add_newdoc_ufunc"><strong>add_newdoc_ufunc</strong></a>(...)</dt><dd><tt>add_ufunc_docstring(ufunc,&nbsp;new_docstring)<br>
&nbsp;<br>
Replace&nbsp;the&nbsp;docstring&nbsp;for&nbsp;a&nbsp;ufunc&nbsp;with&nbsp;new_docstring.<br>
This&nbsp;method&nbsp;will&nbsp;only&nbsp;work&nbsp;if&nbsp;the&nbsp;current&nbsp;docstring&nbsp;for<br>
the&nbsp;ufunc&nbsp;is&nbsp;NULL.&nbsp;(At&nbsp;the&nbsp;C&nbsp;level,&nbsp;i.e.&nbsp;when&nbsp;ufunc-&gt;doc&nbsp;is&nbsp;NULL.)<br>
&nbsp;<br>
Parameters<br>
----------<br>
ufunc&nbsp;:&nbsp;numpy.ufunc<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;ufunc&nbsp;whose&nbsp;current&nbsp;doc&nbsp;is&nbsp;NULL.<br>
new_docstring&nbsp;:&nbsp;string<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;new&nbsp;docstring&nbsp;for&nbsp;the&nbsp;ufunc.<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;method&nbsp;allocates&nbsp;memory&nbsp;for&nbsp;new_docstring&nbsp;on<br>
the&nbsp;heap.&nbsp;Technically&nbsp;this&nbsp;creates&nbsp;a&nbsp;mempory&nbsp;leak,&nbsp;since&nbsp;this<br>
memory&nbsp;will&nbsp;not&nbsp;be&nbsp;reclaimed&nbsp;until&nbsp;the&nbsp;end&nbsp;of&nbsp;the&nbsp;program<br>
even&nbsp;if&nbsp;the&nbsp;ufunc&nbsp;itself&nbsp;is&nbsp;removed.&nbsp;However&nbsp;this&nbsp;will&nbsp;only<br>
be&nbsp;a&nbsp;problem&nbsp;if&nbsp;the&nbsp;user&nbsp;is&nbsp;repeatedly&nbsp;creating&nbsp;ufuncs&nbsp;with<br>
no&nbsp;documentation,&nbsp;adding&nbsp;documentation&nbsp;via&nbsp;add_newdoc_ufunc,<br>
and&nbsp;then&nbsp;throwing&nbsp;away&nbsp;the&nbsp;ufunc.</tt></dd></dl>
 <dl><dt><a name="-alterdot"><strong>alterdot</strong></a>(...)</dt><dd><tt>Change&nbsp;`dot`,&nbsp;`vdot`,&nbsp;and&nbsp;`inner`&nbsp;to&nbsp;use&nbsp;accelerated&nbsp;BLAS&nbsp;functions.<br>
&nbsp;<br>
Typically,&nbsp;as&nbsp;a&nbsp;user&nbsp;of&nbsp;Numpy,&nbsp;you&nbsp;do&nbsp;not&nbsp;explicitly&nbsp;call&nbsp;this&nbsp;function.&nbsp;If<br>
Numpy&nbsp;is&nbsp;built&nbsp;with&nbsp;an&nbsp;accelerated&nbsp;BLAS,&nbsp;this&nbsp;function&nbsp;is&nbsp;automatically<br>
called&nbsp;when&nbsp;Numpy&nbsp;is&nbsp;imported.<br>
&nbsp;<br>
When&nbsp;Numpy&nbsp;is&nbsp;built&nbsp;with&nbsp;an&nbsp;accelerated&nbsp;BLAS&nbsp;like&nbsp;ATLAS,&nbsp;these&nbsp;functions<br>
are&nbsp;replaced&nbsp;to&nbsp;make&nbsp;use&nbsp;of&nbsp;the&nbsp;faster&nbsp;implementations.&nbsp;&nbsp;The&nbsp;faster<br>
implementations&nbsp;only&nbsp;affect&nbsp;float32,&nbsp;float64,&nbsp;complex64,&nbsp;and&nbsp;complex128<br>
arrays.&nbsp;Furthermore,&nbsp;the&nbsp;BLAS&nbsp;API&nbsp;only&nbsp;includes&nbsp;matrix-matrix,<br>
matrix-vector,&nbsp;and&nbsp;vector-vector&nbsp;products.&nbsp;Products&nbsp;of&nbsp;arrays&nbsp;with&nbsp;larger<br>
dimensionalities&nbsp;use&nbsp;the&nbsp;built&nbsp;in&nbsp;functions&nbsp;and&nbsp;are&nbsp;not&nbsp;accelerated.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
restoredot&nbsp;:&nbsp;`restoredot`&nbsp;undoes&nbsp;the&nbsp;effects&nbsp;of&nbsp;`alterdot`.</tt></dd></dl>
 <dl><dt><a name="-arange"><strong>arange</strong></a>(...)</dt><dd><tt><a href="#-arange">arange</a>([start,]&nbsp;stop[,&nbsp;step,],&nbsp;dtype=None)<br>
&nbsp;<br>
Return&nbsp;evenly&nbsp;spaced&nbsp;values&nbsp;within&nbsp;a&nbsp;given&nbsp;interval.<br>
&nbsp;<br>
Values&nbsp;are&nbsp;generated&nbsp;within&nbsp;the&nbsp;half-open&nbsp;interval&nbsp;``[start,&nbsp;stop)``<br>
(in&nbsp;other&nbsp;words,&nbsp;the&nbsp;interval&nbsp;including&nbsp;`start`&nbsp;but&nbsp;excluding&nbsp;`stop`).<br>
For&nbsp;integer&nbsp;arguments&nbsp;the&nbsp;function&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;the&nbsp;Python&nbsp;built-in<br>
`range&nbsp;&lt;<a href="http://docs.python.org/lib/built-in-funcs.html&gt;`_">http://docs.python.org/lib/built-in-funcs.html&gt;`_</a>&nbsp;function,<br>
but&nbsp;returns&nbsp;an&nbsp;ndarray&nbsp;rather&nbsp;than&nbsp;a&nbsp;list.<br>
&nbsp;<br>
When&nbsp;using&nbsp;a&nbsp;non-integer&nbsp;step,&nbsp;such&nbsp;as&nbsp;0.1,&nbsp;the&nbsp;results&nbsp;will&nbsp;often&nbsp;not<br>
be&nbsp;consistent.&nbsp;&nbsp;It&nbsp;is&nbsp;better&nbsp;to&nbsp;use&nbsp;``linspace``&nbsp;for&nbsp;these&nbsp;cases.<br>
&nbsp;<br>
Parameters<br>
----------<br>
start&nbsp;:&nbsp;number,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;of&nbsp;interval.&nbsp;&nbsp;The&nbsp;interval&nbsp;includes&nbsp;this&nbsp;value.&nbsp;&nbsp;The&nbsp;default<br>
&nbsp;&nbsp;&nbsp;&nbsp;start&nbsp;value&nbsp;is&nbsp;0.<br>
stop&nbsp;:&nbsp;number<br>
&nbsp;&nbsp;&nbsp;&nbsp;End&nbsp;of&nbsp;interval.&nbsp;&nbsp;The&nbsp;interval&nbsp;does&nbsp;not&nbsp;include&nbsp;this&nbsp;value,&nbsp;except<br>
&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;some&nbsp;cases&nbsp;where&nbsp;`step`&nbsp;is&nbsp;not&nbsp;an&nbsp;integer&nbsp;and&nbsp;floating&nbsp;point<br>
&nbsp;&nbsp;&nbsp;&nbsp;round-off&nbsp;affects&nbsp;the&nbsp;length&nbsp;of&nbsp;`out`.<br>
step&nbsp;:&nbsp;number,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Spacing&nbsp;between&nbsp;values.&nbsp;&nbsp;For&nbsp;any&nbsp;output&nbsp;`out`,&nbsp;this&nbsp;is&nbsp;the&nbsp;distance<br>
&nbsp;&nbsp;&nbsp;&nbsp;between&nbsp;two&nbsp;adjacent&nbsp;values,&nbsp;``out[i+1]&nbsp;-&nbsp;out[i]``.&nbsp;&nbsp;The&nbsp;default<br>
&nbsp;&nbsp;&nbsp;&nbsp;step&nbsp;size&nbsp;is&nbsp;1.&nbsp;&nbsp;If&nbsp;`step`&nbsp;is&nbsp;specified,&nbsp;`start`&nbsp;must&nbsp;also&nbsp;be&nbsp;given.<br>
dtype&nbsp;:&nbsp;dtype<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;type&nbsp;of&nbsp;the&nbsp;output&nbsp;array.&nbsp;&nbsp;If&nbsp;`dtype`&nbsp;is&nbsp;not&nbsp;given,&nbsp;infer&nbsp;the&nbsp;data<br>
&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;from&nbsp;the&nbsp;other&nbsp;input&nbsp;arguments.<br>
&nbsp;<br>
Returns<br>
-------<br>
arange&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;evenly&nbsp;spaced&nbsp;values.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;floating&nbsp;point&nbsp;arguments,&nbsp;the&nbsp;length&nbsp;of&nbsp;the&nbsp;result&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;``ceil((stop&nbsp;-&nbsp;start)/step)``.&nbsp;&nbsp;Because&nbsp;of&nbsp;floating&nbsp;point&nbsp;overflow,<br>
&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;rule&nbsp;may&nbsp;result&nbsp;in&nbsp;the&nbsp;last&nbsp;element&nbsp;of&nbsp;`out`&nbsp;being&nbsp;greater<br>
&nbsp;&nbsp;&nbsp;&nbsp;than&nbsp;`stop`.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
linspace&nbsp;:&nbsp;Evenly&nbsp;spaced&nbsp;numbers&nbsp;with&nbsp;careful&nbsp;handling&nbsp;of&nbsp;endpoints.<br>
ogrid:&nbsp;Arrays&nbsp;of&nbsp;evenly&nbsp;spaced&nbsp;numbers&nbsp;in&nbsp;N-dimensions.<br>
mgrid:&nbsp;Grid-shaped&nbsp;arrays&nbsp;of&nbsp;evenly&nbsp;spaced&nbsp;numbers&nbsp;in&nbsp;N-dimensions.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-arange">arange</a>(3)<br>
<a href="#-array">array</a>([0,&nbsp;1,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-arange">arange</a>(3.0)<br>
<a href="#-array">array</a>([&nbsp;0.,&nbsp;&nbsp;1.,&nbsp;&nbsp;2.])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-arange">arange</a>(3,7)<br>
<a href="#-array">array</a>([3,&nbsp;4,&nbsp;5,&nbsp;6])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-arange">arange</a>(3,7,2)<br>
<a href="#-array">array</a>([3,&nbsp;5])</tt></dd></dl>
 <dl><dt><a name="-array"><strong>array</strong></a>(...)</dt><dd><tt><a href="#-array">array</a>(object,&nbsp;dtype=None,&nbsp;copy=True,&nbsp;order=None,&nbsp;subok=False,&nbsp;ndmin=0)<br>
&nbsp;<br>
Create&nbsp;an&nbsp;array.<br>
&nbsp;<br>
Parameters<br>
----------<br>
object&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array,&nbsp;any&nbsp;object&nbsp;exposing&nbsp;the&nbsp;array&nbsp;interface,&nbsp;an<br>
&nbsp;&nbsp;&nbsp;&nbsp;object&nbsp;whose&nbsp;__array__&nbsp;method&nbsp;returns&nbsp;an&nbsp;array,&nbsp;or&nbsp;any<br>
&nbsp;&nbsp;&nbsp;&nbsp;(nested)&nbsp;sequence.<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;desired&nbsp;data-type&nbsp;for&nbsp;the&nbsp;array.&nbsp;&nbsp;If&nbsp;not&nbsp;given,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;type&nbsp;will&nbsp;be&nbsp;determined&nbsp;as&nbsp;the&nbsp;minimum&nbsp;type&nbsp;required<br>
&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;hold&nbsp;the&nbsp;objects&nbsp;in&nbsp;the&nbsp;sequence.&nbsp;&nbsp;This&nbsp;argument&nbsp;can&nbsp;only<br>
&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;used&nbsp;to&nbsp;'upcast'&nbsp;the&nbsp;array.&nbsp;&nbsp;For&nbsp;downcasting,&nbsp;use&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;.astype(t)&nbsp;method.<br>
copy&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;true&nbsp;(default),&nbsp;then&nbsp;the&nbsp;object&nbsp;is&nbsp;copied.&nbsp;&nbsp;Otherwise,&nbsp;a&nbsp;copy<br>
&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;only&nbsp;be&nbsp;made&nbsp;if&nbsp;__array__&nbsp;returns&nbsp;a&nbsp;copy,&nbsp;if&nbsp;obj&nbsp;is&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;nested&nbsp;sequence,&nbsp;or&nbsp;if&nbsp;a&nbsp;copy&nbsp;is&nbsp;needed&nbsp;to&nbsp;satisfy&nbsp;any&nbsp;of&nbsp;the&nbsp;other<br>
&nbsp;&nbsp;&nbsp;&nbsp;requirements&nbsp;(`dtype`,&nbsp;`order`,&nbsp;etc.).<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Specify&nbsp;the&nbsp;order&nbsp;of&nbsp;the&nbsp;array.&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'C'&nbsp;(default),&nbsp;then&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;array&nbsp;will&nbsp;be&nbsp;in&nbsp;C-contiguous&nbsp;order&nbsp;(last-index&nbsp;varies&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;fastest).&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'F',&nbsp;then&nbsp;the&nbsp;returned&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;in&nbsp;Fortran-contiguous&nbsp;order&nbsp;(first-index&nbsp;varies&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;fastest).&nbsp;&nbsp;If&nbsp;order&nbsp;is&nbsp;'A',&nbsp;then&nbsp;the&nbsp;returned&nbsp;array&nbsp;may<br>
&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;in&nbsp;any&nbsp;order&nbsp;(either&nbsp;C-,&nbsp;Fortran-contiguous,&nbsp;or&nbsp;even<br>
&nbsp;&nbsp;&nbsp;&nbsp;discontiguous).<br>
subok&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;then&nbsp;sub-classes&nbsp;will&nbsp;be&nbsp;passed-through,&nbsp;otherwise<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;returned&nbsp;array&nbsp;will&nbsp;be&nbsp;forced&nbsp;to&nbsp;be&nbsp;a&nbsp;base-class&nbsp;array&nbsp;(default).<br>
ndmin&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Specifies&nbsp;the&nbsp;minimum&nbsp;number&nbsp;of&nbsp;dimensions&nbsp;that&nbsp;the&nbsp;resulting<br>
&nbsp;&nbsp;&nbsp;&nbsp;array&nbsp;should&nbsp;have.&nbsp;&nbsp;Ones&nbsp;will&nbsp;be&nbsp;pre-pended&nbsp;to&nbsp;the&nbsp;shape&nbsp;as<br>
&nbsp;&nbsp;&nbsp;&nbsp;needed&nbsp;to&nbsp;meet&nbsp;this&nbsp;requirement.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;object&nbsp;satisfying&nbsp;the&nbsp;specified&nbsp;requirements.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
empty,&nbsp;empty_like,&nbsp;zeros,&nbsp;zeros_like,&nbsp;ones,&nbsp;ones_like,&nbsp;fill<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3])<br>
<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3])<br>
&nbsp;<br>
Upcasting:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3.0])<br>
<a href="#-array">array</a>([&nbsp;1.,&nbsp;&nbsp;2.,&nbsp;&nbsp;3.])<br>
&nbsp;<br>
More&nbsp;than&nbsp;one&nbsp;dimension:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>([[1,&nbsp;2],&nbsp;[3,&nbsp;4]])<br>
<a href="#-array">array</a>([[1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4]])<br>
&nbsp;<br>
Minimum&nbsp;dimensions&nbsp;2:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3],&nbsp;ndmin=2)<br>
<a href="#-array">array</a>([[1,&nbsp;2,&nbsp;3]])<br>
&nbsp;<br>
Type&nbsp;provided:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3],&nbsp;dtype=complex)<br>
<a href="#-array">array</a>([&nbsp;1.+0.j,&nbsp;&nbsp;2.+0.j,&nbsp;&nbsp;3.+0.j])<br>
&nbsp;<br>
Data-type&nbsp;consisting&nbsp;of&nbsp;more&nbsp;than&nbsp;one&nbsp;element:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-array">array</a>([(1,2),(3,4)],dtype=[('a','&lt;i4'),('b','&lt;i4')])<br>
&gt;&gt;&gt;&nbsp;x['a']<br>
<a href="#-array">array</a>([1,&nbsp;3])<br>
&nbsp;<br>
Creating&nbsp;an&nbsp;array&nbsp;from&nbsp;sub-classes:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>(np.mat('1&nbsp;2;&nbsp;3&nbsp;4'))<br>
<a href="#-array">array</a>([[1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>(np.mat('1&nbsp;2;&nbsp;3&nbsp;4'),&nbsp;subok=True)<br>
matrix([[1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4]])</tt></dd></dl>
 <dl><dt><a name="-beta"><strong>beta</strong></a>(...)</dt><dd><tt><a href="#-beta">beta</a>(a,&nbsp;b,&nbsp;size=None)<br>
&nbsp;<br>
The&nbsp;Beta&nbsp;distribution&nbsp;over&nbsp;``[0,&nbsp;1]``.<br>
&nbsp;<br>
The&nbsp;Beta&nbsp;distribution&nbsp;is&nbsp;a&nbsp;special&nbsp;case&nbsp;of&nbsp;the&nbsp;Dirichlet&nbsp;distribution,<br>
and&nbsp;is&nbsp;related&nbsp;to&nbsp;the&nbsp;Gamma&nbsp;distribution.&nbsp;&nbsp;It&nbsp;has&nbsp;the&nbsp;probability<br>
distribution&nbsp;function<br>
&nbsp;<br>
..&nbsp;math::&nbsp;<a href="#-f">f</a>(x;&nbsp;a,b)&nbsp;=&nbsp;\frac{1}{B(\alpha,&nbsp;\beta)}&nbsp;x^{\alpha&nbsp;-&nbsp;1}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1&nbsp;-&nbsp;x)^{\beta&nbsp;-&nbsp;1},<br>
&nbsp;<br>
where&nbsp;the&nbsp;normalisation,&nbsp;B,&nbsp;is&nbsp;the&nbsp;beta&nbsp;function,<br>
&nbsp;<br>
..&nbsp;math::&nbsp;B(\alpha,&nbsp;\beta)&nbsp;=&nbsp;\int_0^1&nbsp;t^{\alpha&nbsp;-&nbsp;1}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1&nbsp;-&nbsp;t)^{\beta&nbsp;-&nbsp;1}&nbsp;dt.<br>
&nbsp;<br>
It&nbsp;is&nbsp;often&nbsp;seen&nbsp;in&nbsp;Bayesian&nbsp;inference&nbsp;and&nbsp;order&nbsp;statistics.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Alpha,&nbsp;non-negative.<br>
b&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Beta,&nbsp;non-negative.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;the&nbsp;given&nbsp;shape,&nbsp;containing&nbsp;values&nbsp;drawn&nbsp;from&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;Beta&nbsp;distribution.</tt></dd></dl>
 <dl><dt><a name="-bincount"><strong>bincount</strong></a>(...)</dt><dd><tt><a href="#-bincount">bincount</a>(x,&nbsp;weights=None,&nbsp;minlength=None)<br>
&nbsp;<br>
Count&nbsp;number&nbsp;of&nbsp;occurrences&nbsp;of&nbsp;each&nbsp;value&nbsp;in&nbsp;array&nbsp;of&nbsp;non-negative&nbsp;ints.<br>
&nbsp;<br>
The&nbsp;number&nbsp;of&nbsp;bins&nbsp;(of&nbsp;size&nbsp;1)&nbsp;is&nbsp;one&nbsp;larger&nbsp;than&nbsp;the&nbsp;largest&nbsp;value&nbsp;in<br>
`x`.&nbsp;If&nbsp;`minlength`&nbsp;is&nbsp;specified,&nbsp;there&nbsp;will&nbsp;be&nbsp;at&nbsp;least&nbsp;this&nbsp;number<br>
of&nbsp;bins&nbsp;in&nbsp;the&nbsp;output&nbsp;array&nbsp;(though&nbsp;it&nbsp;will&nbsp;be&nbsp;longer&nbsp;if&nbsp;necessary,<br>
depending&nbsp;on&nbsp;the&nbsp;contents&nbsp;of&nbsp;`x`).<br>
Each&nbsp;bin&nbsp;gives&nbsp;the&nbsp;number&nbsp;of&nbsp;occurrences&nbsp;of&nbsp;its&nbsp;index&nbsp;value&nbsp;in&nbsp;`x`.<br>
If&nbsp;`weights`&nbsp;is&nbsp;specified&nbsp;the&nbsp;input&nbsp;array&nbsp;is&nbsp;weighted&nbsp;by&nbsp;it,&nbsp;i.e.&nbsp;if&nbsp;a<br>
value&nbsp;``n``&nbsp;is&nbsp;found&nbsp;at&nbsp;position&nbsp;``i``,&nbsp;``out[n]&nbsp;+=&nbsp;weight[i]``&nbsp;instead<br>
of&nbsp;``out[n]&nbsp;+=&nbsp;1``.<br>
&nbsp;<br>
Parameters<br>
----------<br>
x&nbsp;:&nbsp;array_like,&nbsp;1&nbsp;dimension,&nbsp;nonnegative&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Input&nbsp;array.<br>
weights&nbsp;:&nbsp;array_like,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Weights,&nbsp;array&nbsp;of&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;`x`.<br>
minlength&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;minimum&nbsp;number&nbsp;of&nbsp;bins&nbsp;for&nbsp;the&nbsp;output&nbsp;array.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;result&nbsp;of&nbsp;binning&nbsp;the&nbsp;input&nbsp;array.<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;length&nbsp;of&nbsp;`out`&nbsp;is&nbsp;equal&nbsp;to&nbsp;``np.amax(x)+1``.<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;input&nbsp;is&nbsp;not&nbsp;1-dimensional,&nbsp;or&nbsp;contains&nbsp;elements&nbsp;with&nbsp;negative<br>
&nbsp;&nbsp;&nbsp;&nbsp;values,&nbsp;or&nbsp;if&nbsp;`minlength`&nbsp;is&nbsp;non-positive.<br>
TypeError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;input&nbsp;is&nbsp;float&nbsp;or&nbsp;complex.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
histogram,&nbsp;digitize,&nbsp;unique<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-bincount">bincount</a>(np.<a href="#-arange">arange</a>(5))<br>
<a href="#-array">array</a>([1,&nbsp;1,&nbsp;1,&nbsp;1,&nbsp;1])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-bincount">bincount</a>(np.<a href="#-array">array</a>([0,&nbsp;1,&nbsp;1,&nbsp;3,&nbsp;2,&nbsp;1,&nbsp;7]))<br>
<a href="#-array">array</a>([1,&nbsp;3,&nbsp;1,&nbsp;1,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;1])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-array">array</a>([0,&nbsp;1,&nbsp;1,&nbsp;3,&nbsp;2,&nbsp;1,&nbsp;7,&nbsp;23])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-bincount">bincount</a>(x).size&nbsp;==&nbsp;np.amax(x)+1<br>
True<br>
&nbsp;<br>
The&nbsp;input&nbsp;array&nbsp;needs&nbsp;to&nbsp;be&nbsp;of&nbsp;integer&nbsp;dtype,&nbsp;otherwise&nbsp;a<br>
TypeError&nbsp;is&nbsp;raised:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-bincount">bincount</a>(np.<a href="#-arange">arange</a>(5,&nbsp;dtype=np.float))<br>
Traceback&nbsp;(most&nbsp;recent&nbsp;call&nbsp;last):<br>
&nbsp;&nbsp;File&nbsp;"&lt;stdin&gt;",&nbsp;line&nbsp;1,&nbsp;in&nbsp;&lt;module&gt;<br>
TypeError:&nbsp;array&nbsp;cannot&nbsp;be&nbsp;safely&nbsp;cast&nbsp;to&nbsp;required&nbsp;type<br>
&nbsp;<br>
A&nbsp;possible&nbsp;use&nbsp;of&nbsp;``bincount``&nbsp;is&nbsp;to&nbsp;perform&nbsp;sums&nbsp;over<br>
variable-size&nbsp;chunks&nbsp;of&nbsp;an&nbsp;array,&nbsp;using&nbsp;the&nbsp;``weights``&nbsp;keyword.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;w&nbsp;=&nbsp;np.<a href="#-array">array</a>([0.3,&nbsp;0.5,&nbsp;0.2,&nbsp;0.7,&nbsp;1.,&nbsp;-0.6])&nbsp;#&nbsp;weights<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-array">array</a>([0,&nbsp;1,&nbsp;1,&nbsp;2,&nbsp;2,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-bincount">bincount</a>(x,&nbsp;&nbsp;weights=w)<br>
<a href="#-array">array</a>([&nbsp;0.3,&nbsp;&nbsp;0.7,&nbsp;&nbsp;1.1])</tt></dd></dl>
 <dl><dt><a name="-binomial"><strong>binomial</strong></a>(...)</dt><dd><tt><a href="#-binomial">binomial</a>(n,&nbsp;p,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;binomial&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Binomial&nbsp;distribution&nbsp;with&nbsp;specified<br>
parameters,&nbsp;n&nbsp;trials&nbsp;and&nbsp;p&nbsp;probability&nbsp;of&nbsp;success&nbsp;where<br>
n&nbsp;an&nbsp;integer&nbsp;&gt;=&nbsp;0&nbsp;and&nbsp;p&nbsp;is&nbsp;in&nbsp;the&nbsp;interval&nbsp;[0,1].&nbsp;(n&nbsp;may&nbsp;be<br>
input&nbsp;as&nbsp;a&nbsp;float,&nbsp;but&nbsp;it&nbsp;is&nbsp;truncated&nbsp;to&nbsp;an&nbsp;integer&nbsp;in&nbsp;use)<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;float&nbsp;(but&nbsp;truncated&nbsp;to&nbsp;an&nbsp;integer)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameter,&nbsp;&gt;=&nbsp;0.<br>
p&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameter,&nbsp;&gt;=&nbsp;0&nbsp;and&nbsp;&lt;=1.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;{ndarray,&nbsp;scalar}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;the&nbsp;values&nbsp;are&nbsp;all&nbsp;integers&nbsp;in&nbsp;&nbsp;[0,&nbsp;n].<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.binom&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Binomial&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(N)&nbsp;=&nbsp;\binom{n}{N}p^N(1-p)^{n-N},<br>
&nbsp;<br>
where&nbsp;:math:`n`&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;trials,&nbsp;:math:`p`&nbsp;is&nbsp;the&nbsp;probability<br>
of&nbsp;success,&nbsp;and&nbsp;:math:`N`&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;successes.<br>
&nbsp;<br>
When&nbsp;estimating&nbsp;the&nbsp;standard&nbsp;error&nbsp;of&nbsp;a&nbsp;proportion&nbsp;in&nbsp;a&nbsp;population&nbsp;by<br>
using&nbsp;a&nbsp;random&nbsp;sample,&nbsp;the&nbsp;normal&nbsp;distribution&nbsp;works&nbsp;well&nbsp;unless&nbsp;the<br>
product&nbsp;p*n&nbsp;&lt;=5,&nbsp;where&nbsp;p&nbsp;=&nbsp;population&nbsp;proportion&nbsp;estimate,&nbsp;and&nbsp;n&nbsp;=<br>
number&nbsp;of&nbsp;samples,&nbsp;in&nbsp;which&nbsp;case&nbsp;the&nbsp;binomial&nbsp;distribution&nbsp;is&nbsp;used<br>
instead.&nbsp;For&nbsp;example,&nbsp;a&nbsp;sample&nbsp;of&nbsp;15&nbsp;people&nbsp;shows&nbsp;4&nbsp;who&nbsp;are&nbsp;left<br>
handed,&nbsp;and&nbsp;11&nbsp;who&nbsp;are&nbsp;right&nbsp;handed.&nbsp;Then&nbsp;p&nbsp;=&nbsp;4/15&nbsp;=&nbsp;27%.&nbsp;0.27*15&nbsp;=&nbsp;4,<br>
so&nbsp;the&nbsp;binomial&nbsp;distribution&nbsp;should&nbsp;be&nbsp;used&nbsp;in&nbsp;this&nbsp;case.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Dalgaard,&nbsp;Peter,&nbsp;"Introductory&nbsp;Statistics&nbsp;with&nbsp;R",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Springer-Verlag,&nbsp;2002.<br>
..&nbsp;[2]&nbsp;Glantz,&nbsp;Stanton&nbsp;A.&nbsp;"Primer&nbsp;of&nbsp;Biostatistics.",&nbsp;McGraw-Hill,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fifth&nbsp;Edition,&nbsp;2002.<br>
..&nbsp;[3]&nbsp;Lentner,&nbsp;Marvin,&nbsp;"Elementary&nbsp;Applied&nbsp;Statistics",&nbsp;Bogden<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;Quigley,&nbsp;1972.<br>
..&nbsp;[4]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Binomial&nbsp;Distribution."&nbsp;From&nbsp;MathWorld--A<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/BinomialDistribution.html">http://mathworld.wolfram.com/BinomialDistribution.html</a><br>
..&nbsp;[5]&nbsp;Wikipedia,&nbsp;"Binomial-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Binomial_distribution">http://en.wikipedia.org/wiki/Binomial_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;n,&nbsp;p&nbsp;=&nbsp;10,&nbsp;.5&nbsp;#&nbsp;number&nbsp;of&nbsp;trials,&nbsp;probability&nbsp;of&nbsp;each&nbsp;trial<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-binomial">binomial</a>(n,&nbsp;p,&nbsp;1000)<br>
#&nbsp;result&nbsp;of&nbsp;flipping&nbsp;a&nbsp;coin&nbsp;10&nbsp;times,&nbsp;tested&nbsp;1000&nbsp;times.<br>
&nbsp;<br>
A&nbsp;real&nbsp;world&nbsp;example.&nbsp;A&nbsp;company&nbsp;drills&nbsp;9&nbsp;wild-cat&nbsp;oil&nbsp;exploration<br>
wells,&nbsp;each&nbsp;with&nbsp;an&nbsp;estimated&nbsp;probability&nbsp;of&nbsp;success&nbsp;of&nbsp;0.1.&nbsp;All&nbsp;nine<br>
wells&nbsp;fail.&nbsp;What&nbsp;is&nbsp;the&nbsp;probability&nbsp;of&nbsp;that&nbsp;happening?<br>
&nbsp;<br>
Let's&nbsp;do&nbsp;20,000&nbsp;trials&nbsp;of&nbsp;the&nbsp;model,&nbsp;and&nbsp;count&nbsp;the&nbsp;number&nbsp;that<br>
generate&nbsp;zero&nbsp;positive&nbsp;results.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;sum(np.random.<a href="#-binomial">binomial</a>(9,0.1,20000)==0)/20000.<br>
answer&nbsp;=&nbsp;0.38885,&nbsp;or&nbsp;38%.</tt></dd></dl>
 <dl><dt><a name="-busday_count"><strong>busday_count</strong></a>(...)</dt><dd><tt><a href="#-busday_count">busday_count</a>(begindates,&nbsp;enddates,&nbsp;weekmask='1111100',&nbsp;holidays=[],&nbsp;busdaycal=None,&nbsp;out=None)<br>
&nbsp;<br>
Counts&nbsp;the&nbsp;number&nbsp;of&nbsp;valid&nbsp;days&nbsp;between&nbsp;`begindates`&nbsp;and<br>
`enddates`,&nbsp;not&nbsp;including&nbsp;the&nbsp;day&nbsp;of&nbsp;`enddates`.<br>
&nbsp;<br>
If&nbsp;``enddates``&nbsp;specifies&nbsp;a&nbsp;date&nbsp;value&nbsp;that&nbsp;is&nbsp;earlier&nbsp;than&nbsp;the<br>
corresponding&nbsp;``begindates``&nbsp;date&nbsp;value,&nbsp;the&nbsp;count&nbsp;will&nbsp;be&nbsp;negative.<br>
&nbsp;<br>
..&nbsp;versionadded::&nbsp;1.7.0<br>
&nbsp;<br>
Parameters<br>
----------<br>
begindates&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D]<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;of&nbsp;the&nbsp;first&nbsp;dates&nbsp;for&nbsp;counting.<br>
enddates&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D]<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;of&nbsp;the&nbsp;end&nbsp;dates&nbsp;for&nbsp;counting,&nbsp;which&nbsp;are&nbsp;excluded<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;count&nbsp;themselves.<br>
weekmask&nbsp;:&nbsp;str&nbsp;or&nbsp;array_like&nbsp;of&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;seven-element&nbsp;array&nbsp;indicating&nbsp;which&nbsp;of&nbsp;Monday&nbsp;through&nbsp;Sunday&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;valid&nbsp;days.&nbsp;May&nbsp;be&nbsp;specified&nbsp;as&nbsp;a&nbsp;length-seven&nbsp;list&nbsp;or&nbsp;array,&nbsp;like<br>
&nbsp;&nbsp;&nbsp;&nbsp;[1,1,1,1,1,0,0];&nbsp;a&nbsp;length-seven&nbsp;string,&nbsp;like&nbsp;'1111100';&nbsp;or&nbsp;a&nbsp;string<br>
&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;"Mon&nbsp;Tue&nbsp;Wed&nbsp;Thu&nbsp;Fri",&nbsp;made&nbsp;up&nbsp;of&nbsp;3-character&nbsp;abbreviations&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;weekdays,&nbsp;optionally&nbsp;separated&nbsp;by&nbsp;white&nbsp;space.&nbsp;Valid&nbsp;abbreviations<br>
&nbsp;&nbsp;&nbsp;&nbsp;are:&nbsp;Mon&nbsp;Tue&nbsp;Wed&nbsp;Thu&nbsp;Fri&nbsp;Sat&nbsp;Sun<br>
holidays&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D],&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;of&nbsp;dates&nbsp;to&nbsp;consider&nbsp;as&nbsp;invalid&nbsp;dates.&nbsp;&nbsp;They&nbsp;may&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;specified&nbsp;in&nbsp;any&nbsp;order,&nbsp;and&nbsp;NaT&nbsp;(not-a-time)&nbsp;dates&nbsp;are&nbsp;ignored.<br>
&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;list&nbsp;is&nbsp;saved&nbsp;in&nbsp;a&nbsp;normalized&nbsp;form&nbsp;that&nbsp;is&nbsp;suited&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;fast&nbsp;calculations&nbsp;of&nbsp;valid&nbsp;days.<br>
busdaycal&nbsp;:&nbsp;busdaycalendar,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;`busdaycalendar`&nbsp;object&nbsp;which&nbsp;specifies&nbsp;the&nbsp;valid&nbsp;days.&nbsp;If&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;parameter&nbsp;is&nbsp;provided,&nbsp;neither&nbsp;weekmask&nbsp;nor&nbsp;holidays&nbsp;may&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;provided.<br>
out&nbsp;:&nbsp;array&nbsp;of&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;this&nbsp;array&nbsp;is&nbsp;filled&nbsp;with&nbsp;the&nbsp;result.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;array&nbsp;of&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;with&nbsp;a&nbsp;shape&nbsp;from&nbsp;broadcasting&nbsp;``begindates``&nbsp;and&nbsp;``enddates``<br>
&nbsp;&nbsp;&nbsp;&nbsp;together,&nbsp;containing&nbsp;the&nbsp;number&nbsp;of&nbsp;valid&nbsp;days&nbsp;between<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;begin&nbsp;and&nbsp;end&nbsp;dates.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
busdaycalendar:&nbsp;An&nbsp;object&nbsp;that&nbsp;specifies&nbsp;a&nbsp;custom&nbsp;set&nbsp;of&nbsp;valid&nbsp;days.<br>
is_busday&nbsp;:&nbsp;Returns&nbsp;a&nbsp;boolean&nbsp;array&nbsp;indicating&nbsp;valid&nbsp;days.<br>
busday_offset&nbsp;:&nbsp;Applies&nbsp;an&nbsp;offset&nbsp;counted&nbsp;in&nbsp;valid&nbsp;days.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;#&nbsp;Number&nbsp;of&nbsp;weekdays&nbsp;in&nbsp;January&nbsp;2011<br>
...&nbsp;np.<a href="#-busday_count">busday_count</a>('2011-01',&nbsp;'2011-02')<br>
21<br>
&gt;&gt;&gt;&nbsp;#&nbsp;Number&nbsp;of&nbsp;weekdays&nbsp;in&nbsp;2011<br>
...&nbsp;&nbsp;np.<a href="#-busday_count">busday_count</a>('2011',&nbsp;'2012')<br>
260<br>
&gt;&gt;&gt;&nbsp;#&nbsp;Number&nbsp;of&nbsp;Saturdays&nbsp;in&nbsp;2011<br>
...&nbsp;np.<a href="#-busday_count">busday_count</a>('2011',&nbsp;'2012',&nbsp;weekmask='Sat')<br>
53</tt></dd></dl>
 <dl><dt><a name="-busday_offset"><strong>busday_offset</strong></a>(...)</dt><dd><tt><a href="#-busday_offset">busday_offset</a>(dates,&nbsp;offsets,&nbsp;roll='raise',&nbsp;weekmask='1111100',&nbsp;holidays=None,&nbsp;busdaycal=None,&nbsp;out=None)<br>
&nbsp;<br>
First&nbsp;adjusts&nbsp;the&nbsp;date&nbsp;to&nbsp;fall&nbsp;on&nbsp;a&nbsp;valid&nbsp;day&nbsp;according&nbsp;to<br>
the&nbsp;``roll``&nbsp;rule,&nbsp;then&nbsp;applies&nbsp;offsets&nbsp;to&nbsp;the&nbsp;given&nbsp;dates<br>
counted&nbsp;in&nbsp;valid&nbsp;days.<br>
&nbsp;<br>
..&nbsp;versionadded::&nbsp;1.7.0<br>
&nbsp;<br>
Parameters<br>
----------<br>
dates&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D]<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;of&nbsp;dates&nbsp;to&nbsp;process.<br>
offsets&nbsp;:&nbsp;array_like&nbsp;of&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;of&nbsp;offsets,&nbsp;which&nbsp;is&nbsp;broadcast&nbsp;with&nbsp;``dates``.<br>
roll&nbsp;:&nbsp;{'raise',&nbsp;'nat',&nbsp;'forward',&nbsp;'following',&nbsp;'backward',&nbsp;'preceding',&nbsp;'modifiedfollowing',&nbsp;'modifiedpreceding'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;How&nbsp;to&nbsp;treat&nbsp;dates&nbsp;that&nbsp;do&nbsp;not&nbsp;fall&nbsp;on&nbsp;a&nbsp;valid&nbsp;day.&nbsp;The&nbsp;default<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;'raise'.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'raise'&nbsp;means&nbsp;to&nbsp;raise&nbsp;an&nbsp;exception&nbsp;for&nbsp;an&nbsp;invalid&nbsp;day.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'nat'&nbsp;means&nbsp;to&nbsp;return&nbsp;a&nbsp;NaT&nbsp;(not-a-time)&nbsp;for&nbsp;an&nbsp;invalid&nbsp;day.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'forward'&nbsp;and&nbsp;'following'&nbsp;mean&nbsp;to&nbsp;take&nbsp;the&nbsp;first&nbsp;valid&nbsp;day<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;later&nbsp;in&nbsp;time.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'backward'&nbsp;and&nbsp;'preceding'&nbsp;mean&nbsp;to&nbsp;take&nbsp;the&nbsp;first&nbsp;valid&nbsp;day<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;earlier&nbsp;in&nbsp;time.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'modifiedfollowing'&nbsp;means&nbsp;to&nbsp;take&nbsp;the&nbsp;first&nbsp;valid&nbsp;day<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;later&nbsp;in&nbsp;time&nbsp;unless&nbsp;it&nbsp;is&nbsp;across&nbsp;a&nbsp;Month&nbsp;boundary,&nbsp;in&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;to&nbsp;take&nbsp;the&nbsp;first&nbsp;valid&nbsp;day&nbsp;earlier&nbsp;in&nbsp;time.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'modifiedpreceding'&nbsp;means&nbsp;to&nbsp;take&nbsp;the&nbsp;first&nbsp;valid&nbsp;day<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;earlier&nbsp;in&nbsp;time&nbsp;unless&nbsp;it&nbsp;is&nbsp;across&nbsp;a&nbsp;Month&nbsp;boundary,&nbsp;in&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;to&nbsp;take&nbsp;the&nbsp;first&nbsp;valid&nbsp;day&nbsp;later&nbsp;in&nbsp;time.<br>
weekmask&nbsp;:&nbsp;str&nbsp;or&nbsp;array_like&nbsp;of&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;seven-element&nbsp;array&nbsp;indicating&nbsp;which&nbsp;of&nbsp;Monday&nbsp;through&nbsp;Sunday&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;valid&nbsp;days.&nbsp;May&nbsp;be&nbsp;specified&nbsp;as&nbsp;a&nbsp;length-seven&nbsp;list&nbsp;or&nbsp;array,&nbsp;like<br>
&nbsp;&nbsp;&nbsp;&nbsp;[1,1,1,1,1,0,0];&nbsp;a&nbsp;length-seven&nbsp;string,&nbsp;like&nbsp;'1111100';&nbsp;or&nbsp;a&nbsp;string<br>
&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;"Mon&nbsp;Tue&nbsp;Wed&nbsp;Thu&nbsp;Fri",&nbsp;made&nbsp;up&nbsp;of&nbsp;3-character&nbsp;abbreviations&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;weekdays,&nbsp;optionally&nbsp;separated&nbsp;by&nbsp;white&nbsp;space.&nbsp;Valid&nbsp;abbreviations<br>
&nbsp;&nbsp;&nbsp;&nbsp;are:&nbsp;Mon&nbsp;Tue&nbsp;Wed&nbsp;Thu&nbsp;Fri&nbsp;Sat&nbsp;Sun<br>
holidays&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D],&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;of&nbsp;dates&nbsp;to&nbsp;consider&nbsp;as&nbsp;invalid&nbsp;dates.&nbsp;&nbsp;They&nbsp;may&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;specified&nbsp;in&nbsp;any&nbsp;order,&nbsp;and&nbsp;NaT&nbsp;(not-a-time)&nbsp;dates&nbsp;are&nbsp;ignored.<br>
&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;list&nbsp;is&nbsp;saved&nbsp;in&nbsp;a&nbsp;normalized&nbsp;form&nbsp;that&nbsp;is&nbsp;suited&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;fast&nbsp;calculations&nbsp;of&nbsp;valid&nbsp;days.<br>
busdaycal&nbsp;:&nbsp;busdaycalendar,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;`busdaycalendar`&nbsp;object&nbsp;which&nbsp;specifies&nbsp;the&nbsp;valid&nbsp;days.&nbsp;If&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;parameter&nbsp;is&nbsp;provided,&nbsp;neither&nbsp;weekmask&nbsp;nor&nbsp;holidays&nbsp;may&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;provided.<br>
out&nbsp;:&nbsp;array&nbsp;of&nbsp;datetime64[D],&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;this&nbsp;array&nbsp;is&nbsp;filled&nbsp;with&nbsp;the&nbsp;result.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;array&nbsp;of&nbsp;datetime64[D]<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;with&nbsp;a&nbsp;shape&nbsp;from&nbsp;broadcasting&nbsp;``dates``&nbsp;and&nbsp;``offsets``<br>
&nbsp;&nbsp;&nbsp;&nbsp;together,&nbsp;containing&nbsp;the&nbsp;dates&nbsp;with&nbsp;offsets&nbsp;applied.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
busdaycalendar:&nbsp;An&nbsp;object&nbsp;that&nbsp;specifies&nbsp;a&nbsp;custom&nbsp;set&nbsp;of&nbsp;valid&nbsp;days.<br>
is_busday&nbsp;:&nbsp;Returns&nbsp;a&nbsp;boolean&nbsp;array&nbsp;indicating&nbsp;valid&nbsp;days.<br>
busday_count&nbsp;:&nbsp;Counts&nbsp;how&nbsp;many&nbsp;valid&nbsp;days&nbsp;are&nbsp;in&nbsp;a&nbsp;half-open&nbsp;date&nbsp;range.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;#&nbsp;First&nbsp;business&nbsp;day&nbsp;in&nbsp;October&nbsp;2011&nbsp;(not&nbsp;accounting&nbsp;for&nbsp;holidays)<br>
...&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2011-10',&nbsp;0,&nbsp;roll='forward')<br>
numpy.datetime64('2011-10-03','D')<br>
&gt;&gt;&gt;&nbsp;#&nbsp;Last&nbsp;business&nbsp;day&nbsp;in&nbsp;February&nbsp;2012&nbsp;(not&nbsp;accounting&nbsp;for&nbsp;holidays)<br>
...&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2012-03',&nbsp;-1,&nbsp;roll='forward')<br>
numpy.datetime64('2012-02-29','D')<br>
&gt;&gt;&gt;&nbsp;#&nbsp;Third&nbsp;Wednesday&nbsp;in&nbsp;January&nbsp;2011<br>
...&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2011-01',&nbsp;2,&nbsp;roll='forward',&nbsp;weekmask='Wed')<br>
numpy.datetime64('2011-01-19','D')<br>
&gt;&gt;&gt;&nbsp;#&nbsp;2012&nbsp;Mother's&nbsp;Day&nbsp;in&nbsp;Canada&nbsp;and&nbsp;the&nbsp;U.S.<br>
...&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2012-05',&nbsp;1,&nbsp;roll='forward',&nbsp;weekmask='Sun')<br>
numpy.datetime64('2012-05-13','D')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;#&nbsp;First&nbsp;business&nbsp;day&nbsp;on&nbsp;or&nbsp;after&nbsp;a&nbsp;date<br>
...&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2011-03-20',&nbsp;0,&nbsp;roll='forward')<br>
numpy.datetime64('2011-03-21','D')<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2011-03-22',&nbsp;0,&nbsp;roll='forward')<br>
numpy.datetime64('2011-03-22','D')<br>
&gt;&gt;&gt;&nbsp;#&nbsp;First&nbsp;business&nbsp;day&nbsp;after&nbsp;a&nbsp;date<br>
...&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2011-03-20',&nbsp;1,&nbsp;roll='backward')<br>
numpy.datetime64('2011-03-21','D')<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-busday_offset">busday_offset</a>('2011-03-22',&nbsp;1,&nbsp;roll='backward')<br>
numpy.datetime64('2011-03-23','D')</tt></dd></dl>
 <dl><dt><a name="-can_cast"><strong>can_cast</strong></a>(...)</dt><dd><tt><a href="#-can_cast">can_cast</a>(from,&nbsp;totype,&nbsp;casting&nbsp;=&nbsp;'safe')<br>
&nbsp;<br>
Returns&nbsp;True&nbsp;if&nbsp;cast&nbsp;between&nbsp;data&nbsp;types&nbsp;can&nbsp;occur&nbsp;according&nbsp;to&nbsp;the<br>
casting&nbsp;rule.&nbsp;&nbsp;If&nbsp;from&nbsp;is&nbsp;a&nbsp;scalar&nbsp;or&nbsp;array&nbsp;scalar,&nbsp;also&nbsp;returns<br>
True&nbsp;if&nbsp;the&nbsp;scalar&nbsp;value&nbsp;can&nbsp;be&nbsp;cast&nbsp;without&nbsp;overflow&nbsp;or&nbsp;truncation<br>
to&nbsp;an&nbsp;integer.<br>
&nbsp;<br>
Parameters<br>
----------<br>
from&nbsp;:&nbsp;dtype,&nbsp;dtype&nbsp;specifier,&nbsp;scalar,&nbsp;or&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;Data&nbsp;type,&nbsp;scalar,&nbsp;or&nbsp;array&nbsp;to&nbsp;cast&nbsp;from.<br>
totype&nbsp;:&nbsp;dtype&nbsp;or&nbsp;dtype&nbsp;specifier<br>
&nbsp;&nbsp;&nbsp;&nbsp;Data&nbsp;type&nbsp;to&nbsp;cast&nbsp;to.<br>
casting&nbsp;:&nbsp;{'no',&nbsp;'equiv',&nbsp;'safe',&nbsp;'same_kind',&nbsp;'unsafe'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;what&nbsp;kind&nbsp;of&nbsp;data&nbsp;casting&nbsp;may&nbsp;occur.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'no'&nbsp;means&nbsp;the&nbsp;data&nbsp;types&nbsp;should&nbsp;not&nbsp;be&nbsp;cast&nbsp;at&nbsp;all.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'equiv'&nbsp;means&nbsp;only&nbsp;byte-order&nbsp;changes&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'safe'&nbsp;means&nbsp;only&nbsp;casts&nbsp;which&nbsp;can&nbsp;preserve&nbsp;values&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'same_kind'&nbsp;means&nbsp;only&nbsp;safe&nbsp;casts&nbsp;or&nbsp;casts&nbsp;within&nbsp;a&nbsp;kind,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;float64&nbsp;to&nbsp;float32,&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'unsafe'&nbsp;means&nbsp;any&nbsp;data&nbsp;conversions&nbsp;may&nbsp;be&nbsp;done.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;bool<br>
&nbsp;&nbsp;&nbsp;&nbsp;True&nbsp;if&nbsp;cast&nbsp;can&nbsp;occur&nbsp;according&nbsp;to&nbsp;the&nbsp;casting&nbsp;rule.<br>
&nbsp;<br>
Notes<br>
-----<br>
Starting&nbsp;in&nbsp;NumPy&nbsp;1.9,&nbsp;can_cast&nbsp;function&nbsp;now&nbsp;returns&nbsp;False&nbsp;in&nbsp;'safe'<br>
casting&nbsp;mode&nbsp;for&nbsp;integer/float&nbsp;dtype&nbsp;and&nbsp;string&nbsp;dtype&nbsp;if&nbsp;the&nbsp;string&nbsp;dtype<br>
length&nbsp;is&nbsp;not&nbsp;long&nbsp;enough&nbsp;to&nbsp;store&nbsp;the&nbsp;max&nbsp;integer/float&nbsp;value&nbsp;converted<br>
to&nbsp;a&nbsp;string.&nbsp;Previously&nbsp;can_cast&nbsp;in&nbsp;'safe'&nbsp;mode&nbsp;returned&nbsp;True&nbsp;for<br>
integer/float&nbsp;dtype&nbsp;and&nbsp;a&nbsp;string&nbsp;dtype&nbsp;of&nbsp;any&nbsp;length.<br>
&nbsp;<br>
See&nbsp;also<br>
--------<br>
dtype,&nbsp;result_type<br>
&nbsp;<br>
Examples<br>
--------<br>
Basic&nbsp;examples<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(np.int32,&nbsp;np.int64)<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(np.float64,&nbsp;np.complex)<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(np.complex,&nbsp;np.float)<br>
False<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('i8',&nbsp;'f8')<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('i8',&nbsp;'f4')<br>
False<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('i4',&nbsp;'S4')<br>
False<br>
&nbsp;<br>
Casting&nbsp;scalars<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(100,&nbsp;'i1')<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(150,&nbsp;'i1')<br>
False<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(150,&nbsp;'u1')<br>
True<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(3.5e100,&nbsp;np.float32)<br>
False<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(1000.0,&nbsp;np.float32)<br>
True<br>
&nbsp;<br>
Array&nbsp;scalar&nbsp;checks&nbsp;the&nbsp;value,&nbsp;array&nbsp;does&nbsp;not<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(np.<a href="#-array">array</a>(1000.0),&nbsp;np.float32)<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>(np.<a href="#-array">array</a>([1000.0]),&nbsp;np.float32)<br>
False<br>
&nbsp;<br>
Using&nbsp;the&nbsp;casting&nbsp;rules<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('i8',&nbsp;'i8',&nbsp;'no')<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i8',&nbsp;'&gt;i8',&nbsp;'no')<br>
False<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i8',&nbsp;'&gt;i8',&nbsp;'equiv')<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i4',&nbsp;'&gt;i8',&nbsp;'equiv')<br>
False<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i4',&nbsp;'&gt;i8',&nbsp;'safe')<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i8',&nbsp;'&gt;i4',&nbsp;'safe')<br>
False<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i8',&nbsp;'&gt;i4',&nbsp;'same_kind')<br>
True<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i8',&nbsp;'&gt;u4',&nbsp;'same_kind')<br>
False<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-can_cast">can_cast</a>('&lt;i8',&nbsp;'&gt;u4',&nbsp;'unsafe')<br>
True</tt></dd></dl>
 <dl><dt><a name="-chisquare"><strong>chisquare</strong></a>(...)</dt><dd><tt><a href="#-chisquare">chisquare</a>(df,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;chi-square&nbsp;distribution.<br>
&nbsp;<br>
When&nbsp;`df`&nbsp;independent&nbsp;random&nbsp;variables,&nbsp;each&nbsp;with&nbsp;standard&nbsp;normal<br>
distributions&nbsp;(mean&nbsp;0,&nbsp;variance&nbsp;1),&nbsp;are&nbsp;squared&nbsp;and&nbsp;summed,&nbsp;the<br>
resulting&nbsp;distribution&nbsp;is&nbsp;chi-square&nbsp;(see&nbsp;Notes).&nbsp;&nbsp;This&nbsp;distribution<br>
is&nbsp;often&nbsp;used&nbsp;in&nbsp;hypothesis&nbsp;testing.<br>
&nbsp;<br>
Parameters<br>
----------<br>
df&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;degrees&nbsp;of&nbsp;freedom.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
output&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Samples&nbsp;drawn&nbsp;from&nbsp;the&nbsp;distribution,&nbsp;packed&nbsp;in&nbsp;a&nbsp;`size`-shaped<br>
&nbsp;&nbsp;&nbsp;&nbsp;array.<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;When&nbsp;`df`&nbsp;&lt;=&nbsp;0&nbsp;or&nbsp;when&nbsp;an&nbsp;inappropriate&nbsp;`size`&nbsp;(e.g.&nbsp;``size=-1``)<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;given.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;variable&nbsp;obtained&nbsp;by&nbsp;summing&nbsp;the&nbsp;squares&nbsp;of&nbsp;`df`&nbsp;independent,<br>
standard&nbsp;normally&nbsp;distributed&nbsp;random&nbsp;variables:<br>
&nbsp;<br>
..&nbsp;math::&nbsp;Q&nbsp;=&nbsp;\sum_{i=0}^{\mathtt{df}}&nbsp;X^2_i<br>
&nbsp;<br>
is&nbsp;chi-square&nbsp;distributed,&nbsp;denoted<br>
&nbsp;<br>
..&nbsp;math::&nbsp;Q&nbsp;\sim&nbsp;\chi^2_k.<br>
&nbsp;<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;of&nbsp;the&nbsp;chi-squared&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{(1/2)^{k/2}}{\Gamma(k/2)}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x^{k/2&nbsp;-&nbsp;1}&nbsp;e^{-x/2},<br>
&nbsp;<br>
where&nbsp;:math:`\Gamma`&nbsp;is&nbsp;the&nbsp;gamma&nbsp;function,<br>
&nbsp;<br>
..&nbsp;math::&nbsp;\Gamma(x)&nbsp;=&nbsp;\int_0^{-\infty}&nbsp;t^{x&nbsp;-&nbsp;1}&nbsp;e^{-t}&nbsp;dt.<br>
&nbsp;<br>
References<br>
----------<br>
`NIST/SEMATECH&nbsp;e-Handbook&nbsp;of&nbsp;Statistical&nbsp;Methods<br>
&lt;<a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm&gt;`_">http://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm&gt;`_</a><br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-chisquare">chisquare</a>(2,4)<br>
<a href="#-array">array</a>([&nbsp;1.89920014,&nbsp;&nbsp;9.00867716,&nbsp;&nbsp;3.13710533,&nbsp;&nbsp;5.62318272])</tt></dd></dl>
 <dl><dt><a name="-compare_chararrays"><strong>compare_chararrays</strong></a>(...)</dt></dl>
 <dl><dt><a name="-concatenate"><strong>concatenate</strong></a>(...)</dt><dd><tt><a href="#-concatenate">concatenate</a>((a1,&nbsp;a2,&nbsp;...),&nbsp;axis=0)<br>
&nbsp;<br>
Join&nbsp;a&nbsp;sequence&nbsp;of&nbsp;arrays&nbsp;together.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a1,&nbsp;a2,&nbsp;...&nbsp;:&nbsp;sequence&nbsp;of&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;arrays&nbsp;must&nbsp;have&nbsp;the&nbsp;same&nbsp;shape,&nbsp;except&nbsp;in&nbsp;the&nbsp;dimension<br>
&nbsp;&nbsp;&nbsp;&nbsp;corresponding&nbsp;to&nbsp;`axis`&nbsp;(the&nbsp;first,&nbsp;by&nbsp;default).<br>
axis&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;axis&nbsp;along&nbsp;which&nbsp;the&nbsp;arrays&nbsp;will&nbsp;be&nbsp;joined.&nbsp;&nbsp;Default&nbsp;is&nbsp;0.<br>
&nbsp;<br>
Returns<br>
-------<br>
res&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;concatenated&nbsp;array.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
ma.concatenate&nbsp;:&nbsp;Concatenate&nbsp;function&nbsp;that&nbsp;preserves&nbsp;input&nbsp;masks.<br>
array_split&nbsp;:&nbsp;Split&nbsp;an&nbsp;array&nbsp;into&nbsp;multiple&nbsp;sub-arrays&nbsp;of&nbsp;equal&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;near-equal&nbsp;size.<br>
split&nbsp;:&nbsp;Split&nbsp;array&nbsp;into&nbsp;a&nbsp;list&nbsp;of&nbsp;multiple&nbsp;sub-arrays&nbsp;of&nbsp;equal&nbsp;size.<br>
hsplit&nbsp;:&nbsp;Split&nbsp;array&nbsp;into&nbsp;multiple&nbsp;sub-arrays&nbsp;horizontally&nbsp;(column&nbsp;wise)<br>
vsplit&nbsp;:&nbsp;Split&nbsp;array&nbsp;into&nbsp;multiple&nbsp;sub-arrays&nbsp;vertically&nbsp;(row&nbsp;wise)<br>
dsplit&nbsp;:&nbsp;Split&nbsp;array&nbsp;into&nbsp;multiple&nbsp;sub-arrays&nbsp;along&nbsp;the&nbsp;3rd&nbsp;axis&nbsp;(depth).<br>
hstack&nbsp;:&nbsp;Stack&nbsp;arrays&nbsp;in&nbsp;sequence&nbsp;horizontally&nbsp;(column&nbsp;wise)<br>
vstack&nbsp;:&nbsp;Stack&nbsp;arrays&nbsp;in&nbsp;sequence&nbsp;vertically&nbsp;(row&nbsp;wise)<br>
dstack&nbsp;:&nbsp;Stack&nbsp;arrays&nbsp;in&nbsp;sequence&nbsp;depth&nbsp;wise&nbsp;(along&nbsp;third&nbsp;dimension)<br>
&nbsp;<br>
Notes<br>
-----<br>
When&nbsp;one&nbsp;or&nbsp;more&nbsp;of&nbsp;the&nbsp;arrays&nbsp;to&nbsp;be&nbsp;concatenated&nbsp;is&nbsp;a&nbsp;MaskedArray,<br>
this&nbsp;function&nbsp;will&nbsp;return&nbsp;a&nbsp;MaskedArray&nbsp;object&nbsp;instead&nbsp;of&nbsp;an&nbsp;ndarray,<br>
but&nbsp;the&nbsp;input&nbsp;masks&nbsp;are&nbsp;*not*&nbsp;preserved.&nbsp;In&nbsp;cases&nbsp;where&nbsp;a&nbsp;MaskedArray<br>
is&nbsp;expected&nbsp;as&nbsp;input,&nbsp;use&nbsp;the&nbsp;ma.concatenate&nbsp;function&nbsp;from&nbsp;the&nbsp;masked<br>
array&nbsp;module&nbsp;instead.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([[1,&nbsp;2],&nbsp;[3,&nbsp;4]])<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-array">array</a>([[5,&nbsp;6]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-concatenate">concatenate</a>((a,&nbsp;b),&nbsp;axis=0)<br>
<a href="#-array">array</a>([[1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[5,&nbsp;6]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-concatenate">concatenate</a>((a,&nbsp;b.T),&nbsp;axis=1)<br>
<a href="#-array">array</a>([[1,&nbsp;2,&nbsp;5],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4,&nbsp;6]])<br>
&nbsp;<br>
This&nbsp;function&nbsp;will&nbsp;not&nbsp;preserve&nbsp;masking&nbsp;of&nbsp;MaskedArray&nbsp;inputs.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.ma.<a href="#-arange">arange</a>(3)<br>
&gt;&gt;&gt;&nbsp;a[1]&nbsp;=&nbsp;np.ma.masked<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(2,&nbsp;5)<br>
&gt;&gt;&gt;&nbsp;a<br>
masked_array(data&nbsp;=&nbsp;[0&nbsp;--&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mask&nbsp;=&nbsp;[False&nbsp;&nbsp;True&nbsp;False],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fill_value&nbsp;=&nbsp;999999)<br>
&gt;&gt;&gt;&nbsp;b<br>
<a href="#-array">array</a>([2,&nbsp;3,&nbsp;4])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-concatenate">concatenate</a>([a,&nbsp;b])<br>
masked_array(data&nbsp;=&nbsp;[0&nbsp;1&nbsp;2&nbsp;2&nbsp;3&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mask&nbsp;=&nbsp;False,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fill_value&nbsp;=&nbsp;999999)<br>
&gt;&gt;&gt;&nbsp;np.ma.<a href="#-concatenate">concatenate</a>([a,&nbsp;b])<br>
masked_array(data&nbsp;=&nbsp;[0&nbsp;--&nbsp;2&nbsp;2&nbsp;3&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mask&nbsp;=&nbsp;[False&nbsp;&nbsp;True&nbsp;False&nbsp;False&nbsp;False&nbsp;False],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fill_value&nbsp;=&nbsp;999999)</tt></dd></dl>
 <dl><dt><a name="-copyto"><strong>copyto</strong></a>(...)</dt><dd><tt><a href="#-copyto">copyto</a>(dst,&nbsp;src,&nbsp;casting='same_kind',&nbsp;where=None,&nbsp;preservena=False)<br>
&nbsp;<br>
Copies&nbsp;values&nbsp;from&nbsp;one&nbsp;array&nbsp;to&nbsp;another,&nbsp;broadcasting&nbsp;as&nbsp;necessary.<br>
&nbsp;<br>
Raises&nbsp;a&nbsp;TypeError&nbsp;if&nbsp;the&nbsp;`casting`&nbsp;rule&nbsp;is&nbsp;violated,&nbsp;and&nbsp;if<br>
`where`&nbsp;is&nbsp;provided,&nbsp;it&nbsp;selects&nbsp;which&nbsp;elements&nbsp;to&nbsp;copy.<br>
&nbsp;<br>
..&nbsp;versionadded::&nbsp;1.7.0<br>
&nbsp;<br>
Parameters<br>
----------<br>
dst&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;into&nbsp;which&nbsp;values&nbsp;are&nbsp;copied.<br>
src&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;from&nbsp;which&nbsp;values&nbsp;are&nbsp;copied.<br>
casting&nbsp;:&nbsp;{'no',&nbsp;'equiv',&nbsp;'safe',&nbsp;'same_kind',&nbsp;'unsafe'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;what&nbsp;kind&nbsp;of&nbsp;data&nbsp;casting&nbsp;may&nbsp;occur&nbsp;when&nbsp;copying.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'no'&nbsp;means&nbsp;the&nbsp;data&nbsp;types&nbsp;should&nbsp;not&nbsp;be&nbsp;cast&nbsp;at&nbsp;all.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'equiv'&nbsp;means&nbsp;only&nbsp;byte-order&nbsp;changes&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'safe'&nbsp;means&nbsp;only&nbsp;casts&nbsp;which&nbsp;can&nbsp;preserve&nbsp;values&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'same_kind'&nbsp;means&nbsp;only&nbsp;safe&nbsp;casts&nbsp;or&nbsp;casts&nbsp;within&nbsp;a&nbsp;kind,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;float64&nbsp;to&nbsp;float32,&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'unsafe'&nbsp;means&nbsp;any&nbsp;data&nbsp;conversions&nbsp;may&nbsp;be&nbsp;done.<br>
where&nbsp;:&nbsp;array_like&nbsp;of&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;boolean&nbsp;array&nbsp;which&nbsp;is&nbsp;broadcasted&nbsp;to&nbsp;match&nbsp;the&nbsp;dimensions<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;`dst`,&nbsp;and&nbsp;selects&nbsp;elements&nbsp;to&nbsp;copy&nbsp;from&nbsp;`src`&nbsp;to&nbsp;`dst`<br>
&nbsp;&nbsp;&nbsp;&nbsp;wherever&nbsp;it&nbsp;contains&nbsp;the&nbsp;value&nbsp;True.<br>
preservena&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;set&nbsp;to&nbsp;True,&nbsp;leaves&nbsp;any&nbsp;NA&nbsp;values&nbsp;in&nbsp;`dst`&nbsp;untouched.&nbsp;This<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;similar&nbsp;to&nbsp;the&nbsp;"hard&nbsp;mask"&nbsp;feature&nbsp;in&nbsp;numpy.ma.</tt></dd></dl>
 <dl><dt><a name="-count_nonzero"><strong>count_nonzero</strong></a>(...)</dt><dd><tt><a href="#-count_nonzero">count_nonzero</a>(a)<br>
&nbsp;<br>
Counts&nbsp;the&nbsp;number&nbsp;of&nbsp;non-zero&nbsp;values&nbsp;in&nbsp;the&nbsp;array&nbsp;``a``.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;for&nbsp;which&nbsp;to&nbsp;count&nbsp;non-zeros.<br>
&nbsp;<br>
Returns<br>
-------<br>
count&nbsp;:&nbsp;int&nbsp;or&nbsp;array&nbsp;of&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;non-zero&nbsp;values&nbsp;in&nbsp;the&nbsp;array.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
nonzero&nbsp;:&nbsp;Return&nbsp;the&nbsp;coordinates&nbsp;of&nbsp;all&nbsp;the&nbsp;non-zero&nbsp;values.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-count_nonzero">count_nonzero</a>(np.eye(4))<br>
4<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-count_nonzero">count_nonzero</a>([[0,1,7,0,0],[3,0,0,2,19]])<br>
5</tt></dd></dl>
 <dl><dt><a name="-datetime_as_string"><strong>datetime_as_string</strong></a>(...)</dt></dl>
 <dl><dt><a name="-datetime_data"><strong>datetime_data</strong></a>(...)</dt></dl>
 <dl><dt><a name="-digitize"><strong>digitize</strong></a>(...)</dt><dd><tt><a href="#-digitize">digitize</a>(x,&nbsp;bins,&nbsp;right=False)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;indices&nbsp;of&nbsp;the&nbsp;bins&nbsp;to&nbsp;which&nbsp;each&nbsp;value&nbsp;in&nbsp;input&nbsp;array&nbsp;belongs.<br>
&nbsp;<br>
Each&nbsp;index&nbsp;``i``&nbsp;returned&nbsp;is&nbsp;such&nbsp;that&nbsp;``bins[i-1]&nbsp;&lt;=&nbsp;x&nbsp;&lt;&nbsp;bins[i]``&nbsp;if<br>
`bins`&nbsp;is&nbsp;monotonically&nbsp;increasing,&nbsp;or&nbsp;``bins[i-1]&nbsp;&gt;&nbsp;x&nbsp;&gt;=&nbsp;bins[i]``&nbsp;if<br>
`bins`&nbsp;is&nbsp;monotonically&nbsp;decreasing.&nbsp;If&nbsp;values&nbsp;in&nbsp;`x`&nbsp;are&nbsp;beyond&nbsp;the<br>
bounds&nbsp;of&nbsp;`bins`,&nbsp;0&nbsp;or&nbsp;``len(bins)``&nbsp;is&nbsp;returned&nbsp;as&nbsp;appropriate.&nbsp;If&nbsp;right<br>
is&nbsp;True,&nbsp;then&nbsp;the&nbsp;right&nbsp;bin&nbsp;is&nbsp;closed&nbsp;so&nbsp;that&nbsp;the&nbsp;index&nbsp;``i``&nbsp;is&nbsp;such<br>
that&nbsp;``bins[i-1]&nbsp;&lt;&nbsp;x&nbsp;&lt;=&nbsp;bins[i]``&nbsp;or&nbsp;bins[i-1]&nbsp;&gt;=&nbsp;x&nbsp;&gt;&nbsp;bins[i]``&nbsp;if&nbsp;`bins`<br>
is&nbsp;monotonically&nbsp;increasing&nbsp;or&nbsp;decreasing,&nbsp;respectively.<br>
&nbsp;<br>
Parameters<br>
----------<br>
x&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Input&nbsp;array&nbsp;to&nbsp;be&nbsp;binned.&nbsp;It&nbsp;has&nbsp;to&nbsp;be&nbsp;1-dimensional.<br>
bins&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;bins.&nbsp;It&nbsp;has&nbsp;to&nbsp;be&nbsp;1-dimensional&nbsp;and&nbsp;monotonic.<br>
right&nbsp;:&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Indicating&nbsp;whether&nbsp;the&nbsp;intervals&nbsp;include&nbsp;the&nbsp;right&nbsp;or&nbsp;the&nbsp;left&nbsp;bin<br>
&nbsp;&nbsp;&nbsp;&nbsp;edge.&nbsp;Default&nbsp;behavior&nbsp;is&nbsp;(right==False)&nbsp;indicating&nbsp;that&nbsp;the&nbsp;interval<br>
&nbsp;&nbsp;&nbsp;&nbsp;does&nbsp;not&nbsp;include&nbsp;the&nbsp;right&nbsp;edge.&nbsp;The&nbsp;left&nbsp;bin&nbsp;and&nbsp;is&nbsp;open&nbsp;in&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;case.&nbsp;Ie.,&nbsp;bins[i-1]&nbsp;&lt;=&nbsp;x&nbsp;&lt;&nbsp;bins[i]&nbsp;is&nbsp;the&nbsp;default&nbsp;behavior&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;monotonically&nbsp;increasing&nbsp;bins.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;array&nbsp;of&nbsp;indices,&nbsp;of&nbsp;same&nbsp;shape&nbsp;as&nbsp;`x`.<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;input&nbsp;is&nbsp;not&nbsp;1-dimensional,&nbsp;or&nbsp;if&nbsp;`bins`&nbsp;is&nbsp;not&nbsp;monotonic.<br>
TypeError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;type&nbsp;of&nbsp;the&nbsp;input&nbsp;is&nbsp;complex.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
bincount,&nbsp;histogram,&nbsp;unique<br>
&nbsp;<br>
Notes<br>
-----<br>
If&nbsp;values&nbsp;in&nbsp;`x`&nbsp;are&nbsp;such&nbsp;that&nbsp;they&nbsp;fall&nbsp;outside&nbsp;the&nbsp;bin&nbsp;range,<br>
attempting&nbsp;to&nbsp;index&nbsp;`bins`&nbsp;with&nbsp;the&nbsp;indices&nbsp;that&nbsp;`digitize`&nbsp;returns<br>
will&nbsp;result&nbsp;in&nbsp;an&nbsp;IndexError.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-array">array</a>([0.2,&nbsp;6.4,&nbsp;3.0,&nbsp;1.6])<br>
&gt;&gt;&gt;&nbsp;bins&nbsp;=&nbsp;np.<a href="#-array">array</a>([0.0,&nbsp;1.0,&nbsp;2.5,&nbsp;4.0,&nbsp;10.0])<br>
&gt;&gt;&gt;&nbsp;inds&nbsp;=&nbsp;np.<a href="#-digitize">digitize</a>(x,&nbsp;bins)<br>
&gt;&gt;&gt;&nbsp;inds<br>
<a href="#-array">array</a>([1,&nbsp;4,&nbsp;3,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;for&nbsp;n&nbsp;in&nbsp;range(x.size):<br>
...&nbsp;&nbsp;&nbsp;print&nbsp;bins[inds[n]-1],&nbsp;"&lt;=",&nbsp;x[n],&nbsp;"&lt;",&nbsp;bins[inds[n]]<br>
...<br>
0.0&nbsp;&lt;=&nbsp;0.2&nbsp;&lt;&nbsp;1.0<br>
4.0&nbsp;&lt;=&nbsp;6.4&nbsp;&lt;&nbsp;10.0<br>
2.5&nbsp;&lt;=&nbsp;3.0&nbsp;&lt;&nbsp;4.0<br>
1.0&nbsp;&lt;=&nbsp;1.6&nbsp;&lt;&nbsp;2.5<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-array">array</a>([1.2,&nbsp;10.0,&nbsp;12.4,&nbsp;15.5,&nbsp;20.])<br>
&gt;&gt;&gt;&nbsp;bins&nbsp;=&nbsp;np.<a href="#-array">array</a>([0,5,10,15,20])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-digitize">digitize</a>(x,bins,right=True)<br>
<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3,&nbsp;4,&nbsp;4])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-digitize">digitize</a>(x,bins,right=False)<br>
<a href="#-array">array</a>([1,&nbsp;3,&nbsp;3,&nbsp;4,&nbsp;5])</tt></dd></dl>
 <dl><dt><a name="-dot"><strong>dot</strong></a>(...)</dt><dd><tt><a href="#-dot">dot</a>(a,&nbsp;b,&nbsp;out=None)<br>
&nbsp;<br>
Dot&nbsp;product&nbsp;of&nbsp;two&nbsp;arrays.<br>
&nbsp;<br>
For&nbsp;2-D&nbsp;arrays&nbsp;it&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;matrix&nbsp;multiplication,&nbsp;and&nbsp;for&nbsp;1-D<br>
arrays&nbsp;to&nbsp;inner&nbsp;product&nbsp;of&nbsp;vectors&nbsp;(without&nbsp;complex&nbsp;conjugation).&nbsp;For<br>
N&nbsp;dimensions&nbsp;it&nbsp;is&nbsp;a&nbsp;sum&nbsp;product&nbsp;over&nbsp;the&nbsp;last&nbsp;axis&nbsp;of&nbsp;`a`&nbsp;and<br>
the&nbsp;second-to-last&nbsp;of&nbsp;`b`::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;<a href="#-dot">dot</a>(a,&nbsp;b)[i,j,k,m]&nbsp;=&nbsp;sum(a[i,j,:]&nbsp;*&nbsp;b[k,:,m])<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;First&nbsp;argument.<br>
b&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Second&nbsp;argument.<br>
out&nbsp;:&nbsp;ndarray,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;argument.&nbsp;This&nbsp;must&nbsp;have&nbsp;the&nbsp;exact&nbsp;kind&nbsp;that&nbsp;would&nbsp;be&nbsp;returned<br>
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;it&nbsp;was&nbsp;not&nbsp;used.&nbsp;In&nbsp;particular,&nbsp;it&nbsp;must&nbsp;have&nbsp;the&nbsp;right&nbsp;type,&nbsp;must&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;C-contiguous,&nbsp;and&nbsp;its&nbsp;dtype&nbsp;must&nbsp;be&nbsp;the&nbsp;dtype&nbsp;that&nbsp;would&nbsp;be&nbsp;returned<br>
&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;`<a href="#-dot">dot</a>(a,b)`.&nbsp;This&nbsp;is&nbsp;a&nbsp;performance&nbsp;feature.&nbsp;Therefore,&nbsp;if&nbsp;these<br>
&nbsp;&nbsp;&nbsp;&nbsp;conditions&nbsp;are&nbsp;not&nbsp;met,&nbsp;an&nbsp;exception&nbsp;is&nbsp;raised,&nbsp;instead&nbsp;of&nbsp;attempting<br>
&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;be&nbsp;flexible.<br>
&nbsp;<br>
Returns<br>
-------<br>
output&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Returns&nbsp;the&nbsp;dot&nbsp;product&nbsp;of&nbsp;`a`&nbsp;and&nbsp;`b`.&nbsp;&nbsp;If&nbsp;`a`&nbsp;and&nbsp;`b`&nbsp;are&nbsp;both<br>
&nbsp;&nbsp;&nbsp;&nbsp;scalars&nbsp;or&nbsp;both&nbsp;1-D&nbsp;arrays&nbsp;then&nbsp;a&nbsp;scalar&nbsp;is&nbsp;returned;&nbsp;otherwise<br>
&nbsp;&nbsp;&nbsp;&nbsp;an&nbsp;array&nbsp;is&nbsp;returned.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`out`&nbsp;is&nbsp;given,&nbsp;then&nbsp;it&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;last&nbsp;dimension&nbsp;of&nbsp;`a`&nbsp;is&nbsp;not&nbsp;the&nbsp;same&nbsp;size&nbsp;as<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;second-to-last&nbsp;dimension&nbsp;of&nbsp;`b`.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
vdot&nbsp;:&nbsp;Complex-conjugating&nbsp;dot&nbsp;product.<br>
tensordot&nbsp;:&nbsp;Sum&nbsp;products&nbsp;over&nbsp;arbitrary&nbsp;axes.<br>
einsum&nbsp;:&nbsp;Einstein&nbsp;summation&nbsp;convention.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-dot">dot</a>(3,&nbsp;4)<br>
12<br>
&nbsp;<br>
Neither&nbsp;argument&nbsp;is&nbsp;complex-conjugated:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-dot">dot</a>([2j,&nbsp;3j],&nbsp;[2j,&nbsp;3j])<br>
(-13+0j)<br>
&nbsp;<br>
For&nbsp;2-D&nbsp;arrays&nbsp;it's&nbsp;the&nbsp;matrix&nbsp;product:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;[[1,&nbsp;0],&nbsp;[0,&nbsp;1]]<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;[[4,&nbsp;1],&nbsp;[2,&nbsp;2]]<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-dot">dot</a>(a,&nbsp;b)<br>
<a href="#-array">array</a>([[4,&nbsp;1],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;2]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(3*4*5*6).reshape((3,4,5,6))<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(3*4*5*6)[::-1].reshape((5,4,6,3))<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-dot">dot</a>(a,&nbsp;b)[2,3,2,1,2,2]<br>
499128<br>
&gt;&gt;&gt;&nbsp;sum(a[2,3,2,:]&nbsp;*&nbsp;b[1,2,:,2])<br>
499128</tt></dd></dl>
 <dl><dt><a name="-einsum"><strong>einsum</strong></a>(...)</dt><dd><tt><a href="#-einsum">einsum</a>(subscripts,&nbsp;*operands,&nbsp;out=None,&nbsp;dtype=None,&nbsp;order='K',&nbsp;casting='safe')<br>
&nbsp;<br>
Evaluates&nbsp;the&nbsp;Einstein&nbsp;summation&nbsp;convention&nbsp;on&nbsp;the&nbsp;operands.<br>
&nbsp;<br>
Using&nbsp;the&nbsp;Einstein&nbsp;summation&nbsp;convention,&nbsp;many&nbsp;common&nbsp;multi-dimensional<br>
array&nbsp;operations&nbsp;can&nbsp;be&nbsp;represented&nbsp;in&nbsp;a&nbsp;simple&nbsp;fashion.&nbsp;&nbsp;This&nbsp;function<br>
provides&nbsp;a&nbsp;way&nbsp;compute&nbsp;such&nbsp;summations.&nbsp;The&nbsp;best&nbsp;way&nbsp;to&nbsp;understand&nbsp;this<br>
function&nbsp;is&nbsp;to&nbsp;try&nbsp;the&nbsp;examples&nbsp;below,&nbsp;which&nbsp;show&nbsp;how&nbsp;many&nbsp;common&nbsp;NumPy<br>
functions&nbsp;can&nbsp;be&nbsp;implemented&nbsp;as&nbsp;calls&nbsp;to&nbsp;`einsum`.<br>
&nbsp;<br>
Parameters<br>
----------<br>
subscripts&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;Specifies&nbsp;the&nbsp;subscripts&nbsp;for&nbsp;summation.<br>
operands&nbsp;:&nbsp;list&nbsp;of&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;These&nbsp;are&nbsp;the&nbsp;arrays&nbsp;for&nbsp;the&nbsp;operation.<br>
out&nbsp;:&nbsp;ndarray,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;the&nbsp;calculation&nbsp;is&nbsp;done&nbsp;into&nbsp;this&nbsp;array.<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;forces&nbsp;the&nbsp;calculation&nbsp;to&nbsp;use&nbsp;the&nbsp;data&nbsp;type&nbsp;specified.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Note&nbsp;that&nbsp;you&nbsp;may&nbsp;have&nbsp;to&nbsp;also&nbsp;give&nbsp;a&nbsp;more&nbsp;liberal&nbsp;`casting`<br>
&nbsp;&nbsp;&nbsp;&nbsp;parameter&nbsp;to&nbsp;allow&nbsp;the&nbsp;conversions.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A',&nbsp;'K'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;the&nbsp;memory&nbsp;layout&nbsp;of&nbsp;the&nbsp;output.&nbsp;'C'&nbsp;means&nbsp;it&nbsp;should<br>
&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;C&nbsp;contiguous.&nbsp;'F'&nbsp;means&nbsp;it&nbsp;should&nbsp;be&nbsp;Fortran&nbsp;contiguous,<br>
&nbsp;&nbsp;&nbsp;&nbsp;'A'&nbsp;means&nbsp;it&nbsp;should&nbsp;be&nbsp;'F'&nbsp;if&nbsp;the&nbsp;inputs&nbsp;are&nbsp;all&nbsp;'F',&nbsp;'C'&nbsp;otherwise.<br>
&nbsp;&nbsp;&nbsp;&nbsp;'K'&nbsp;means&nbsp;it&nbsp;should&nbsp;be&nbsp;as&nbsp;close&nbsp;to&nbsp;the&nbsp;layout&nbsp;as&nbsp;the&nbsp;inputs&nbsp;as<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;possible,&nbsp;including&nbsp;arbitrarily&nbsp;permuted&nbsp;axes.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Default&nbsp;is&nbsp;'K'.<br>
casting&nbsp;:&nbsp;{'no',&nbsp;'equiv',&nbsp;'safe',&nbsp;'same_kind',&nbsp;'unsafe'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Controls&nbsp;what&nbsp;kind&nbsp;of&nbsp;data&nbsp;casting&nbsp;may&nbsp;occur.&nbsp;&nbsp;Setting&nbsp;this&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;'unsafe'&nbsp;is&nbsp;not&nbsp;recommended,&nbsp;as&nbsp;it&nbsp;can&nbsp;adversely&nbsp;affect&nbsp;accumulations.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'no'&nbsp;means&nbsp;the&nbsp;data&nbsp;types&nbsp;should&nbsp;not&nbsp;be&nbsp;cast&nbsp;at&nbsp;all.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'equiv'&nbsp;means&nbsp;only&nbsp;byte-order&nbsp;changes&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'safe'&nbsp;means&nbsp;only&nbsp;casts&nbsp;which&nbsp;can&nbsp;preserve&nbsp;values&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'same_kind'&nbsp;means&nbsp;only&nbsp;safe&nbsp;casts&nbsp;or&nbsp;casts&nbsp;within&nbsp;a&nbsp;kind,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;float64&nbsp;to&nbsp;float32,&nbsp;are&nbsp;allowed.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'unsafe'&nbsp;means&nbsp;any&nbsp;data&nbsp;conversions&nbsp;may&nbsp;be&nbsp;done.<br>
&nbsp;<br>
Returns<br>
-------<br>
output&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;calculation&nbsp;based&nbsp;on&nbsp;the&nbsp;Einstein&nbsp;summation&nbsp;convention.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
dot,&nbsp;inner,&nbsp;outer,&nbsp;tensordot<br>
&nbsp;<br>
Notes<br>
-----<br>
..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;<br>
The&nbsp;subscripts&nbsp;string&nbsp;is&nbsp;a&nbsp;comma-separated&nbsp;list&nbsp;of&nbsp;subscript&nbsp;labels,<br>
where&nbsp;each&nbsp;label&nbsp;refers&nbsp;to&nbsp;a&nbsp;dimension&nbsp;of&nbsp;the&nbsp;corresponding&nbsp;operand.<br>
Repeated&nbsp;subscripts&nbsp;labels&nbsp;in&nbsp;one&nbsp;operand&nbsp;take&nbsp;the&nbsp;diagonal.&nbsp;&nbsp;For&nbsp;example,<br>
``np.<a href="#-einsum">einsum</a>('ii',&nbsp;a)``&nbsp;is&nbsp;equivalent&nbsp;to&nbsp;``np.trace(a)``.<br>
&nbsp;<br>
Whenever&nbsp;a&nbsp;label&nbsp;is&nbsp;repeated,&nbsp;it&nbsp;is&nbsp;summed,&nbsp;so&nbsp;``np.<a href="#-einsum">einsum</a>('i,i',&nbsp;a,&nbsp;b)``<br>
is&nbsp;equivalent&nbsp;to&nbsp;``np.<a href="#-inner">inner</a>(a,b)``.&nbsp;&nbsp;If&nbsp;a&nbsp;label&nbsp;appears&nbsp;only&nbsp;once,<br>
it&nbsp;is&nbsp;not&nbsp;summed,&nbsp;so&nbsp;``np.<a href="#-einsum">einsum</a>('i',&nbsp;a)``&nbsp;produces&nbsp;a&nbsp;view&nbsp;of&nbsp;``a``<br>
with&nbsp;no&nbsp;changes.<br>
&nbsp;<br>
The&nbsp;order&nbsp;of&nbsp;labels&nbsp;in&nbsp;the&nbsp;output&nbsp;is&nbsp;by&nbsp;default&nbsp;alphabetical.&nbsp;&nbsp;This<br>
means&nbsp;that&nbsp;``np.<a href="#-einsum">einsum</a>('ij',&nbsp;a)``&nbsp;doesn't&nbsp;affect&nbsp;a&nbsp;2D&nbsp;array,&nbsp;while<br>
``np.<a href="#-einsum">einsum</a>('ji',&nbsp;a)``&nbsp;takes&nbsp;its&nbsp;transpose.<br>
&nbsp;<br>
The&nbsp;output&nbsp;can&nbsp;be&nbsp;controlled&nbsp;by&nbsp;specifying&nbsp;output&nbsp;subscript&nbsp;labels<br>
as&nbsp;well.&nbsp;&nbsp;This&nbsp;specifies&nbsp;the&nbsp;label&nbsp;order,&nbsp;and&nbsp;allows&nbsp;summing&nbsp;to<br>
be&nbsp;disallowed&nbsp;or&nbsp;forced&nbsp;when&nbsp;desired.&nbsp;&nbsp;The&nbsp;call&nbsp;``np.<a href="#-einsum">einsum</a>('i-&gt;',&nbsp;a)``<br>
is&nbsp;like&nbsp;``np.sum(a,&nbsp;axis=-1)``,&nbsp;and&nbsp;``np.<a href="#-einsum">einsum</a>('ii-&gt;i',&nbsp;a)``<br>
is&nbsp;like&nbsp;``np.diag(a)``.&nbsp;&nbsp;The&nbsp;difference&nbsp;is&nbsp;that&nbsp;`einsum`&nbsp;does&nbsp;not<br>
allow&nbsp;broadcasting&nbsp;by&nbsp;default.<br>
&nbsp;<br>
To&nbsp;enable&nbsp;and&nbsp;control&nbsp;broadcasting,&nbsp;use&nbsp;an&nbsp;ellipsis.&nbsp;&nbsp;Default<br>
NumPy-style&nbsp;broadcasting&nbsp;is&nbsp;done&nbsp;by&nbsp;adding&nbsp;an&nbsp;ellipsis<br>
to&nbsp;the&nbsp;left&nbsp;of&nbsp;each&nbsp;term,&nbsp;like&nbsp;``np.<a href="#-einsum">einsum</a>('...ii-&gt;...i',&nbsp;a)``.<br>
To&nbsp;take&nbsp;the&nbsp;trace&nbsp;along&nbsp;the&nbsp;first&nbsp;and&nbsp;last&nbsp;axes,<br>
you&nbsp;can&nbsp;do&nbsp;``np.<a href="#-einsum">einsum</a>('i...i',&nbsp;a)``,&nbsp;or&nbsp;to&nbsp;do&nbsp;a&nbsp;matrix-matrix<br>
product&nbsp;with&nbsp;the&nbsp;left-most&nbsp;indices&nbsp;instead&nbsp;of&nbsp;rightmost,&nbsp;you&nbsp;can&nbsp;do<br>
``np.<a href="#-einsum">einsum</a>('ij...,jk...-&gt;ik...',&nbsp;a,&nbsp;b)``.<br>
&nbsp;<br>
When&nbsp;there&nbsp;is&nbsp;only&nbsp;one&nbsp;operand,&nbsp;no&nbsp;axes&nbsp;are&nbsp;summed,&nbsp;and&nbsp;no&nbsp;output<br>
parameter&nbsp;is&nbsp;provided,&nbsp;a&nbsp;view&nbsp;into&nbsp;the&nbsp;operand&nbsp;is&nbsp;returned&nbsp;instead<br>
of&nbsp;a&nbsp;new&nbsp;array.&nbsp;&nbsp;Thus,&nbsp;taking&nbsp;the&nbsp;diagonal&nbsp;as&nbsp;``np.<a href="#-einsum">einsum</a>('ii-&gt;i',&nbsp;a)``<br>
produces&nbsp;a&nbsp;view.<br>
&nbsp;<br>
An&nbsp;alternative&nbsp;way&nbsp;to&nbsp;provide&nbsp;the&nbsp;subscripts&nbsp;and&nbsp;operands&nbsp;is&nbsp;as<br>
``<a href="#-einsum">einsum</a>(op0,&nbsp;sublist0,&nbsp;op1,&nbsp;sublist1,&nbsp;...,&nbsp;[sublistout])``.&nbsp;The&nbsp;examples<br>
below&nbsp;have&nbsp;corresponding&nbsp;`einsum`&nbsp;calls&nbsp;with&nbsp;the&nbsp;two&nbsp;parameter&nbsp;methods.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(25).reshape(5,5)<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(5)<br>
&gt;&gt;&gt;&nbsp;c&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(6).reshape(2,3)<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ii',&nbsp;a)<br>
60<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(a,&nbsp;[0,0])<br>
60<br>
&gt;&gt;&gt;&nbsp;np.trace(a)<br>
60<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ii-&gt;i',&nbsp;a)<br>
<a href="#-array">array</a>([&nbsp;0,&nbsp;&nbsp;6,&nbsp;12,&nbsp;18,&nbsp;24])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(a,&nbsp;[0,0],&nbsp;[0])<br>
<a href="#-array">array</a>([&nbsp;0,&nbsp;&nbsp;6,&nbsp;12,&nbsp;18,&nbsp;24])<br>
&gt;&gt;&gt;&nbsp;np.diag(a)<br>
<a href="#-array">array</a>([&nbsp;0,&nbsp;&nbsp;6,&nbsp;12,&nbsp;18,&nbsp;24])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ij,j',&nbsp;a,&nbsp;b)<br>
<a href="#-array">array</a>([&nbsp;30,&nbsp;&nbsp;80,&nbsp;130,&nbsp;180,&nbsp;230])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(a,&nbsp;[0,1],&nbsp;b,&nbsp;[1])<br>
<a href="#-array">array</a>([&nbsp;30,&nbsp;&nbsp;80,&nbsp;130,&nbsp;180,&nbsp;230])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-dot">dot</a>(a,&nbsp;b)<br>
<a href="#-array">array</a>([&nbsp;30,&nbsp;&nbsp;80,&nbsp;130,&nbsp;180,&nbsp;230])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('...j,j',&nbsp;a,&nbsp;b)<br>
<a href="#-array">array</a>([&nbsp;30,&nbsp;&nbsp;80,&nbsp;130,&nbsp;180,&nbsp;230])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ji',&nbsp;c)<br>
<a href="#-array">array</a>([[0,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;5]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(c,&nbsp;[1,0])<br>
<a href="#-array">array</a>([[0,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;5]])<br>
&gt;&gt;&gt;&nbsp;c.T<br>
<a href="#-array">array</a>([[0,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;5]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('...,&nbsp;...',&nbsp;3,&nbsp;c)<br>
<a href="#-array">array</a>([[&nbsp;0,&nbsp;&nbsp;3,&nbsp;&nbsp;6],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;9,&nbsp;12,&nbsp;15]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(3,&nbsp;[Ellipsis],&nbsp;c,&nbsp;[Ellipsis])<br>
<a href="#-array">array</a>([[&nbsp;0,&nbsp;&nbsp;3,&nbsp;&nbsp;6],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;9,&nbsp;12,&nbsp;15]])<br>
&gt;&gt;&gt;&nbsp;np.multiply(3,&nbsp;c)<br>
<a href="#-array">array</a>([[&nbsp;0,&nbsp;&nbsp;3,&nbsp;&nbsp;6],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;9,&nbsp;12,&nbsp;15]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('i,i',&nbsp;b,&nbsp;b)<br>
30<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(b,&nbsp;[0],&nbsp;b,&nbsp;[0])<br>
30<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-inner">inner</a>(b,b)<br>
30<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('i,j',&nbsp;np.<a href="#-arange">arange</a>(2)+1,&nbsp;b)<br>
<a href="#-array">array</a>([[0,&nbsp;1,&nbsp;2,&nbsp;3,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;2,&nbsp;4,&nbsp;6,&nbsp;8]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(np.<a href="#-arange">arange</a>(2)+1,&nbsp;[0],&nbsp;b,&nbsp;[1])<br>
<a href="#-array">array</a>([[0,&nbsp;1,&nbsp;2,&nbsp;3,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;2,&nbsp;4,&nbsp;6,&nbsp;8]])<br>
&gt;&gt;&gt;&nbsp;np.outer(np.<a href="#-arange">arange</a>(2)+1,&nbsp;b)<br>
<a href="#-array">array</a>([[0,&nbsp;1,&nbsp;2,&nbsp;3,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;2,&nbsp;4,&nbsp;6,&nbsp;8]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('i...-&gt;...',&nbsp;a)<br>
<a href="#-array">array</a>([50,&nbsp;55,&nbsp;60,&nbsp;65,&nbsp;70])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(a,&nbsp;[0,Ellipsis],&nbsp;[Ellipsis])<br>
<a href="#-array">array</a>([50,&nbsp;55,&nbsp;60,&nbsp;65,&nbsp;70])<br>
&gt;&gt;&gt;&nbsp;np.sum(a,&nbsp;axis=0)<br>
<a href="#-array">array</a>([50,&nbsp;55,&nbsp;60,&nbsp;65,&nbsp;70])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(60.).reshape(3,4,5)<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(24.).reshape(4,3,2)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ijk,jil-&gt;kl',&nbsp;a,&nbsp;b)<br>
<a href="#-array">array</a>([[&nbsp;4400.,&nbsp;&nbsp;4730.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4532.,&nbsp;&nbsp;4874.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4664.,&nbsp;&nbsp;5018.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4796.,&nbsp;&nbsp;5162.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4928.,&nbsp;&nbsp;5306.]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>(a,&nbsp;[0,1,2],&nbsp;b,&nbsp;[1,0,3],&nbsp;[2,3])<br>
<a href="#-array">array</a>([[&nbsp;4400.,&nbsp;&nbsp;4730.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4532.,&nbsp;&nbsp;4874.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4664.,&nbsp;&nbsp;5018.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4796.,&nbsp;&nbsp;5162.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4928.,&nbsp;&nbsp;5306.]])<br>
&gt;&gt;&gt;&nbsp;np.tensordot(a,b,&nbsp;axes=([1,0],[0,1]))<br>
<a href="#-array">array</a>([[&nbsp;4400.,&nbsp;&nbsp;4730.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4532.,&nbsp;&nbsp;4874.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4664.,&nbsp;&nbsp;5018.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4796.,&nbsp;&nbsp;5162.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;4928.,&nbsp;&nbsp;5306.]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(6).reshape((3,2))<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(12).reshape((4,3))<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ki,jk-&gt;ij',&nbsp;a,&nbsp;b)<br>
<a href="#-array">array</a>([[10,&nbsp;28,&nbsp;46,&nbsp;64],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[13,&nbsp;40,&nbsp;67,&nbsp;94]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('ki,...k-&gt;i...',&nbsp;a,&nbsp;b)<br>
<a href="#-array">array</a>([[10,&nbsp;28,&nbsp;46,&nbsp;64],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[13,&nbsp;40,&nbsp;67,&nbsp;94]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-einsum">einsum</a>('k...,jk',&nbsp;a,&nbsp;b)<br>
<a href="#-array">array</a>([[10,&nbsp;28,&nbsp;46,&nbsp;64],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[13,&nbsp;40,&nbsp;67,&nbsp;94]])</tt></dd></dl>
 <dl><dt><a name="-empty"><strong>empty</strong></a>(...)</dt><dd><tt><a href="#-empty">empty</a>(shape,&nbsp;dtype=float,&nbsp;order='C')<br>
&nbsp;<br>
Return&nbsp;a&nbsp;new&nbsp;array&nbsp;of&nbsp;given&nbsp;shape&nbsp;and&nbsp;type,&nbsp;without&nbsp;initializing&nbsp;entries.<br>
&nbsp;<br>
Parameters<br>
----------<br>
shape&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Shape&nbsp;of&nbsp;the&nbsp;empty&nbsp;array<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Desired&nbsp;output&nbsp;data-type.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Whether&nbsp;to&nbsp;store&nbsp;multi-dimensional&nbsp;data&nbsp;in&nbsp;C&nbsp;(row-major)&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;Fortran&nbsp;(column-major)&nbsp;order&nbsp;in&nbsp;memory.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;uninitialized&nbsp;(arbitrary)&nbsp;data&nbsp;with&nbsp;the&nbsp;given<br>
&nbsp;&nbsp;&nbsp;&nbsp;shape,&nbsp;dtype,&nbsp;and&nbsp;order.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
empty_like,&nbsp;zeros,&nbsp;ones<br>
&nbsp;<br>
Notes<br>
-----<br>
`empty`,&nbsp;unlike&nbsp;`zeros`,&nbsp;does&nbsp;not&nbsp;set&nbsp;the&nbsp;array&nbsp;values&nbsp;to&nbsp;zero,<br>
and&nbsp;may&nbsp;therefore&nbsp;be&nbsp;marginally&nbsp;faster.&nbsp;&nbsp;On&nbsp;the&nbsp;other&nbsp;hand,&nbsp;it&nbsp;requires<br>
the&nbsp;user&nbsp;to&nbsp;manually&nbsp;set&nbsp;all&nbsp;the&nbsp;values&nbsp;in&nbsp;the&nbsp;array,&nbsp;and&nbsp;should&nbsp;be<br>
used&nbsp;with&nbsp;caution.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-empty">empty</a>([2,&nbsp;2])<br>
<a href="#-array">array</a>([[&nbsp;-9.74499359e+001,&nbsp;&nbsp;&nbsp;6.69583040e-309],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;2.13182611e-314,&nbsp;&nbsp;&nbsp;3.06959433e-309]])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#random<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-empty">empty</a>([2,&nbsp;2],&nbsp;dtype=int)<br>
<a href="#-array">array</a>([[-1073741821,&nbsp;-1067949133],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;496041986,&nbsp;&nbsp;&nbsp;&nbsp;19249760]])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#random</tt></dd></dl>
 <dl><dt><a name="-empty_like"><strong>empty_like</strong></a>(...)</dt><dd><tt><a href="#-empty_like">empty_like</a>(a,&nbsp;dtype=None,&nbsp;order='K',&nbsp;subok=True)<br>
&nbsp;<br>
Return&nbsp;a&nbsp;new&nbsp;array&nbsp;with&nbsp;the&nbsp;same&nbsp;shape&nbsp;and&nbsp;type&nbsp;as&nbsp;a&nbsp;given&nbsp;array.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;shape&nbsp;and&nbsp;data-type&nbsp;of&nbsp;`a`&nbsp;define&nbsp;these&nbsp;same&nbsp;attributes&nbsp;of&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;returned&nbsp;array.<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;&nbsp;&nbsp;&nbsp;Overrides&nbsp;the&nbsp;data&nbsp;type&nbsp;of&nbsp;the&nbsp;result.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F',&nbsp;'A',&nbsp;or&nbsp;'K'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;&nbsp;&nbsp;&nbsp;Overrides&nbsp;the&nbsp;memory&nbsp;layout&nbsp;of&nbsp;the&nbsp;result.&nbsp;'C'&nbsp;means&nbsp;C-order,<br>
&nbsp;&nbsp;&nbsp;&nbsp;'F'&nbsp;means&nbsp;F-order,&nbsp;'A'&nbsp;means&nbsp;'F'&nbsp;if&nbsp;``a``&nbsp;is&nbsp;Fortran&nbsp;contiguous,<br>
&nbsp;&nbsp;&nbsp;&nbsp;'C'&nbsp;otherwise.&nbsp;'K'&nbsp;means&nbsp;match&nbsp;the&nbsp;layout&nbsp;of&nbsp;``a``&nbsp;as&nbsp;closely<br>
&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;possible.<br>
subok&nbsp;:&nbsp;bool,&nbsp;optional.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;then&nbsp;the&nbsp;newly&nbsp;created&nbsp;array&nbsp;will&nbsp;use&nbsp;the&nbsp;sub-class<br>
&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;of&nbsp;'a',&nbsp;otherwise&nbsp;it&nbsp;will&nbsp;be&nbsp;a&nbsp;base-class&nbsp;array.&nbsp;Defaults<br>
&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;True.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;uninitialized&nbsp;(arbitrary)&nbsp;data&nbsp;with&nbsp;the&nbsp;same<br>
&nbsp;&nbsp;&nbsp;&nbsp;shape&nbsp;and&nbsp;type&nbsp;as&nbsp;`a`.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
ones_like&nbsp;:&nbsp;Return&nbsp;an&nbsp;array&nbsp;of&nbsp;ones&nbsp;with&nbsp;shape&nbsp;and&nbsp;type&nbsp;of&nbsp;input.<br>
zeros_like&nbsp;:&nbsp;Return&nbsp;an&nbsp;array&nbsp;of&nbsp;zeros&nbsp;with&nbsp;shape&nbsp;and&nbsp;type&nbsp;of&nbsp;input.<br>
empty&nbsp;:&nbsp;Return&nbsp;a&nbsp;new&nbsp;uninitialized&nbsp;array.<br>
ones&nbsp;:&nbsp;Return&nbsp;a&nbsp;new&nbsp;array&nbsp;setting&nbsp;values&nbsp;to&nbsp;one.<br>
zeros&nbsp;:&nbsp;Return&nbsp;a&nbsp;new&nbsp;array&nbsp;setting&nbsp;values&nbsp;to&nbsp;zero.<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;function&nbsp;does&nbsp;*not*&nbsp;initialize&nbsp;the&nbsp;returned&nbsp;array;&nbsp;to&nbsp;do&nbsp;that&nbsp;use<br>
`zeros_like`&nbsp;or&nbsp;`ones_like`&nbsp;instead.&nbsp;&nbsp;It&nbsp;may&nbsp;be&nbsp;marginally&nbsp;faster&nbsp;than<br>
the&nbsp;functions&nbsp;that&nbsp;do&nbsp;set&nbsp;the&nbsp;array&nbsp;values.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;([1,2,3],&nbsp;[4,5,6])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;a&nbsp;is&nbsp;array-like<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-empty_like">empty_like</a>(a)<br>
<a href="#-array">array</a>([[-1073741821,&nbsp;-1073741821,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3],&nbsp;&nbsp;&nbsp;&nbsp;#random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0,&nbsp;-1073741821]])<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([[1.,&nbsp;2.,&nbsp;3.],[4.,5.,6.]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-empty_like">empty_like</a>(a)<br>
<a href="#-array">array</a>([[&nbsp;-2.00000715e+000,&nbsp;&nbsp;&nbsp;1.48219694e-323,&nbsp;&nbsp;-2.00000572e+000],#random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;&nbsp;4.38791518e-305,&nbsp;&nbsp;-2.00000715e+000,&nbsp;&nbsp;&nbsp;4.17269252e-309]])</tt></dd></dl>
 <dl><dt><a name="-exponential"><strong>exponential</strong></a>(...)</dt><dd><tt><a href="#-exponential">exponential</a>(scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Exponential&nbsp;distribution.<br>
&nbsp;<br>
Its&nbsp;probability&nbsp;density&nbsp;function&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;<a href="#-f">f</a>(x;&nbsp;\frac{1}{\beta})&nbsp;=&nbsp;\frac{1}{\beta}&nbsp;\exp(-\frac{x}{\beta}),<br>
&nbsp;<br>
for&nbsp;``x&nbsp;&gt;&nbsp;0``&nbsp;and&nbsp;0&nbsp;elsewhere.&nbsp;:math:`\beta`&nbsp;is&nbsp;the&nbsp;scale&nbsp;parameter,<br>
which&nbsp;is&nbsp;the&nbsp;inverse&nbsp;of&nbsp;the&nbsp;rate&nbsp;parameter&nbsp;:math:`\lambda&nbsp;=&nbsp;1/\beta`.<br>
The&nbsp;rate&nbsp;parameter&nbsp;is&nbsp;an&nbsp;alternative,&nbsp;widely&nbsp;used&nbsp;parameterization<br>
of&nbsp;the&nbsp;exponential&nbsp;distribution&nbsp;[3]_.<br>
&nbsp;<br>
The&nbsp;exponential&nbsp;distribution&nbsp;is&nbsp;a&nbsp;continuous&nbsp;analogue&nbsp;of&nbsp;the<br>
geometric&nbsp;distribution.&nbsp;&nbsp;It&nbsp;describes&nbsp;many&nbsp;common&nbsp;situations,&nbsp;such&nbsp;as<br>
the&nbsp;size&nbsp;of&nbsp;raindrops&nbsp;measured&nbsp;over&nbsp;many&nbsp;rainstorms&nbsp;[1]_,&nbsp;or&nbsp;the&nbsp;time<br>
between&nbsp;page&nbsp;requests&nbsp;to&nbsp;Wikipedia&nbsp;[2]_.<br>
&nbsp;<br>
Parameters<br>
----------<br>
scale&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;scale&nbsp;parameter,&nbsp;:math:`\beta&nbsp;=&nbsp;1/\lambda`.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Peyton&nbsp;Z.&nbsp;Peebles&nbsp;Jr.,&nbsp;"Probability,&nbsp;Random&nbsp;Variables&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Random&nbsp;Signal&nbsp;Principles",&nbsp;4th&nbsp;ed,&nbsp;2001,&nbsp;p.&nbsp;57.<br>
..&nbsp;[2]&nbsp;"Poisson&nbsp;Process",&nbsp;Wikipedia,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Poisson_process">http://en.wikipedia.org/wiki/Poisson_process</a><br>
..&nbsp;[3]&nbsp;"Exponential&nbsp;Distribution,&nbsp;Wikipedia,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Exponential_distribution">http://en.wikipedia.org/wiki/Exponential_distribution</a></tt></dd></dl>
 <dl><dt><a name="-f"><strong>f</strong></a>(...)</dt><dd><tt><a href="#-f">f</a>(dfnum,&nbsp;dfden,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;F&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;an&nbsp;F&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;parameters,<br>
`dfnum`&nbsp;(degrees&nbsp;of&nbsp;freedom&nbsp;in&nbsp;numerator)&nbsp;and&nbsp;`dfden`&nbsp;(degrees&nbsp;of&nbsp;freedom<br>
in&nbsp;denominator),&nbsp;where&nbsp;both&nbsp;parameters&nbsp;should&nbsp;be&nbsp;greater&nbsp;than&nbsp;zero.<br>
&nbsp;<br>
The&nbsp;random&nbsp;variate&nbsp;of&nbsp;the&nbsp;F&nbsp;distribution&nbsp;(also&nbsp;known&nbsp;as&nbsp;the<br>
Fisher&nbsp;distribution)&nbsp;is&nbsp;a&nbsp;continuous&nbsp;probability&nbsp;distribution<br>
that&nbsp;arises&nbsp;in&nbsp;ANOVA&nbsp;tests,&nbsp;and&nbsp;is&nbsp;the&nbsp;ratio&nbsp;of&nbsp;two&nbsp;chi-square<br>
variates.<br>
&nbsp;<br>
Parameters<br>
----------<br>
dfnum&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Degrees&nbsp;of&nbsp;freedom&nbsp;in&nbsp;numerator.&nbsp;Should&nbsp;be&nbsp;greater&nbsp;than&nbsp;zero.<br>
dfden&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Degrees&nbsp;of&nbsp;freedom&nbsp;in&nbsp;denominator.&nbsp;Should&nbsp;be&nbsp;greater&nbsp;than&nbsp;zero.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;{ndarray,&nbsp;scalar}<br>
&nbsp;&nbsp;&nbsp;&nbsp;Samples&nbsp;from&nbsp;the&nbsp;Fisher&nbsp;distribution.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.f&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;F&nbsp;statistic&nbsp;is&nbsp;used&nbsp;to&nbsp;compare&nbsp;in-group&nbsp;variances&nbsp;to&nbsp;between-group<br>
variances.&nbsp;Calculating&nbsp;the&nbsp;distribution&nbsp;depends&nbsp;on&nbsp;the&nbsp;sampling,&nbsp;and<br>
so&nbsp;it&nbsp;is&nbsp;a&nbsp;function&nbsp;of&nbsp;the&nbsp;respective&nbsp;degrees&nbsp;of&nbsp;freedom&nbsp;in&nbsp;the<br>
problem.&nbsp;&nbsp;The&nbsp;variable&nbsp;`dfnum`&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;samples&nbsp;minus&nbsp;one,&nbsp;the<br>
between-groups&nbsp;degrees&nbsp;of&nbsp;freedom,&nbsp;while&nbsp;`dfden`&nbsp;is&nbsp;the&nbsp;within-groups<br>
degrees&nbsp;of&nbsp;freedom,&nbsp;the&nbsp;sum&nbsp;of&nbsp;the&nbsp;number&nbsp;of&nbsp;samples&nbsp;in&nbsp;each&nbsp;group<br>
minus&nbsp;the&nbsp;number&nbsp;of&nbsp;groups.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Glantz,&nbsp;Stanton&nbsp;A.&nbsp;"Primer&nbsp;of&nbsp;Biostatistics.",&nbsp;McGraw-Hill,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fifth&nbsp;Edition,&nbsp;2002.<br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"F-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/F-distribution">http://en.wikipedia.org/wiki/F-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
An&nbsp;example&nbsp;from&nbsp;Glantz[1],&nbsp;pp&nbsp;47-40.<br>
Two&nbsp;groups,&nbsp;children&nbsp;of&nbsp;diabetics&nbsp;(25&nbsp;people)&nbsp;and&nbsp;children&nbsp;from&nbsp;people<br>
without&nbsp;diabetes&nbsp;(25&nbsp;controls).&nbsp;Fasting&nbsp;blood&nbsp;glucose&nbsp;was&nbsp;measured,<br>
case&nbsp;group&nbsp;had&nbsp;a&nbsp;mean&nbsp;value&nbsp;of&nbsp;86.1,&nbsp;controls&nbsp;had&nbsp;a&nbsp;mean&nbsp;value&nbsp;of<br>
82.2.&nbsp;Standard&nbsp;deviations&nbsp;were&nbsp;2.09&nbsp;and&nbsp;2.49&nbsp;respectively.&nbsp;Are&nbsp;these<br>
data&nbsp;consistent&nbsp;with&nbsp;the&nbsp;null&nbsp;hypothesis&nbsp;that&nbsp;the&nbsp;parents&nbsp;diabetic<br>
status&nbsp;does&nbsp;not&nbsp;affect&nbsp;their&nbsp;children's&nbsp;blood&nbsp;glucose&nbsp;levels?<br>
Calculating&nbsp;the&nbsp;F&nbsp;statistic&nbsp;from&nbsp;the&nbsp;data&nbsp;gives&nbsp;a&nbsp;value&nbsp;of&nbsp;36.01.<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;dfnum&nbsp;=&nbsp;1.&nbsp;#&nbsp;between&nbsp;group&nbsp;degrees&nbsp;of&nbsp;freedom<br>
&gt;&gt;&gt;&nbsp;dfden&nbsp;=&nbsp;48.&nbsp;#&nbsp;within&nbsp;groups&nbsp;degrees&nbsp;of&nbsp;freedom<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-f">f</a>(dfnum,&nbsp;dfden,&nbsp;1000)<br>
&nbsp;<br>
The&nbsp;lower&nbsp;bound&nbsp;for&nbsp;the&nbsp;top&nbsp;1%&nbsp;of&nbsp;the&nbsp;samples&nbsp;is&nbsp;:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;sort(s)[-10]<br>
7.61988120985<br>
&nbsp;<br>
So&nbsp;there&nbsp;is&nbsp;about&nbsp;a&nbsp;1%&nbsp;chance&nbsp;that&nbsp;the&nbsp;F&nbsp;statistic&nbsp;will&nbsp;exceed&nbsp;7.62,<br>
the&nbsp;measured&nbsp;value&nbsp;is&nbsp;36,&nbsp;so&nbsp;the&nbsp;null&nbsp;hypothesis&nbsp;is&nbsp;rejected&nbsp;at&nbsp;the&nbsp;1%<br>
level.</tt></dd></dl>
 <dl><dt><a name="-fastCopyAndTranspose"><strong>fastCopyAndTranspose</strong></a> = _fastCopyAndTranspose(...)</dt><dd><tt>_fastCopyAndTranspose(a)</tt></dd></dl>
 <dl><dt><a name="-fp_str"><strong>fp_str</strong></a>(...)</dt><dd><tt><a href="#-fp_str">fp_str</a>(a0,&nbsp;a1,...)&nbsp;convert&nbsp;numerics&nbsp;to&nbsp;blank&nbsp;separated&nbsp;string</tt></dd></dl>
 <dl><dt><a name="-frombuffer"><strong>frombuffer</strong></a>(...)</dt><dd><tt><a href="#-frombuffer">frombuffer</a>(buffer,&nbsp;dtype=float,&nbsp;count=-1,&nbsp;offset=0)<br>
&nbsp;<br>
Interpret&nbsp;a&nbsp;buffer&nbsp;as&nbsp;a&nbsp;1-dimensional&nbsp;array.<br>
&nbsp;<br>
Parameters<br>
----------<br>
buffer&nbsp;:&nbsp;buffer_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;object&nbsp;that&nbsp;exposes&nbsp;the&nbsp;buffer&nbsp;interface.<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Data-type&nbsp;of&nbsp;the&nbsp;returned&nbsp;array;&nbsp;default:&nbsp;float.<br>
count&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;items&nbsp;to&nbsp;read.&nbsp;``-1``&nbsp;means&nbsp;all&nbsp;data&nbsp;in&nbsp;the&nbsp;buffer.<br>
offset&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Start&nbsp;reading&nbsp;the&nbsp;buffer&nbsp;from&nbsp;this&nbsp;offset;&nbsp;default:&nbsp;0.<br>
&nbsp;<br>
Notes<br>
-----<br>
If&nbsp;the&nbsp;buffer&nbsp;has&nbsp;data&nbsp;that&nbsp;is&nbsp;not&nbsp;in&nbsp;machine&nbsp;byte-order,&nbsp;this&nbsp;should<br>
be&nbsp;specified&nbsp;as&nbsp;part&nbsp;of&nbsp;the&nbsp;data-type,&nbsp;e.g.::<br>
&nbsp;<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;dt&nbsp;=&nbsp;np.dtype(int)<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;dt&nbsp;=&nbsp;dt.newbyteorder('&gt;')<br>
&nbsp;&nbsp;&gt;&gt;&gt;&nbsp;np.<a href="#-frombuffer">frombuffer</a>(buf,&nbsp;dtype=dt)<br>
&nbsp;<br>
The&nbsp;data&nbsp;of&nbsp;the&nbsp;resulting&nbsp;array&nbsp;will&nbsp;not&nbsp;be&nbsp;byteswapped,&nbsp;but&nbsp;will&nbsp;be<br>
interpreted&nbsp;correctly.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;'hello&nbsp;world'<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-frombuffer">frombuffer</a>(s,&nbsp;dtype='S1',&nbsp;count=5,&nbsp;offset=6)<br>
<a href="#-array">array</a>(['w',&nbsp;'o',&nbsp;'r',&nbsp;'l',&nbsp;'d'],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype='|S1')</tt></dd></dl>
 <dl><dt><a name="-fromfile"><strong>fromfile</strong></a>(...)</dt><dd><tt><a href="#-fromfile">fromfile</a>(file,&nbsp;dtype=float,&nbsp;count=-1,&nbsp;sep='')<br>
&nbsp;<br>
Construct&nbsp;an&nbsp;array&nbsp;from&nbsp;data&nbsp;in&nbsp;a&nbsp;text&nbsp;or&nbsp;binary&nbsp;file.<br>
&nbsp;<br>
A&nbsp;highly&nbsp;efficient&nbsp;way&nbsp;of&nbsp;reading&nbsp;binary&nbsp;data&nbsp;with&nbsp;a&nbsp;known&nbsp;data-type,<br>
as&nbsp;well&nbsp;as&nbsp;parsing&nbsp;simply&nbsp;formatted&nbsp;text&nbsp;files.&nbsp;&nbsp;Data&nbsp;written&nbsp;using&nbsp;the<br>
`tofile`&nbsp;method&nbsp;can&nbsp;be&nbsp;read&nbsp;using&nbsp;this&nbsp;function.<br>
&nbsp;<br>
Parameters<br>
----------<br>
file&nbsp;:&nbsp;file&nbsp;or&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;Open&nbsp;file&nbsp;object&nbsp;or&nbsp;filename.<br>
dtype&nbsp;:&nbsp;data-type<br>
&nbsp;&nbsp;&nbsp;&nbsp;Data&nbsp;type&nbsp;of&nbsp;the&nbsp;returned&nbsp;array.<br>
&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;binary&nbsp;files,&nbsp;it&nbsp;is&nbsp;used&nbsp;to&nbsp;determine&nbsp;the&nbsp;size&nbsp;and&nbsp;byte-order<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;items&nbsp;in&nbsp;the&nbsp;file.<br>
count&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;items&nbsp;to&nbsp;read.&nbsp;``-1``&nbsp;means&nbsp;all&nbsp;items&nbsp;(i.e.,&nbsp;the&nbsp;complete<br>
&nbsp;&nbsp;&nbsp;&nbsp;file).<br>
sep&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;Separator&nbsp;between&nbsp;items&nbsp;if&nbsp;file&nbsp;is&nbsp;a&nbsp;text&nbsp;file.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Empty&nbsp;("")&nbsp;separator&nbsp;means&nbsp;the&nbsp;file&nbsp;should&nbsp;be&nbsp;treated&nbsp;as&nbsp;binary.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Spaces&nbsp;("&nbsp;")&nbsp;in&nbsp;the&nbsp;separator&nbsp;match&nbsp;zero&nbsp;or&nbsp;more&nbsp;whitespace&nbsp;characters.<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;separator&nbsp;consisting&nbsp;only&nbsp;of&nbsp;spaces&nbsp;must&nbsp;match&nbsp;at&nbsp;least&nbsp;one<br>
&nbsp;&nbsp;&nbsp;&nbsp;whitespace.<br>
&nbsp;<br>
See&nbsp;also<br>
--------<br>
load,&nbsp;save<br>
ndarray.tofile<br>
loadtxt&nbsp;:&nbsp;More&nbsp;flexible&nbsp;way&nbsp;of&nbsp;loading&nbsp;data&nbsp;from&nbsp;a&nbsp;text&nbsp;file.<br>
&nbsp;<br>
Notes<br>
-----<br>
Do&nbsp;not&nbsp;rely&nbsp;on&nbsp;the&nbsp;combination&nbsp;of&nbsp;`tofile`&nbsp;and&nbsp;`fromfile`&nbsp;for<br>
data&nbsp;storage,&nbsp;as&nbsp;the&nbsp;binary&nbsp;files&nbsp;generated&nbsp;are&nbsp;are&nbsp;not&nbsp;platform<br>
independent.&nbsp;&nbsp;In&nbsp;particular,&nbsp;no&nbsp;byte-order&nbsp;or&nbsp;data-type&nbsp;information&nbsp;is<br>
saved.&nbsp;&nbsp;Data&nbsp;can&nbsp;be&nbsp;stored&nbsp;in&nbsp;the&nbsp;platform&nbsp;independent&nbsp;``.npy``&nbsp;format<br>
using&nbsp;`save`&nbsp;and&nbsp;`load`&nbsp;instead.<br>
&nbsp;<br>
Examples<br>
--------<br>
Construct&nbsp;an&nbsp;ndarray:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;dt&nbsp;=&nbsp;np.dtype([('time',&nbsp;[('min',&nbsp;int),&nbsp;('sec',&nbsp;int)]),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;('temp',&nbsp;float)])<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-zeros">zeros</a>((1,),&nbsp;dtype=dt)<br>
&gt;&gt;&gt;&nbsp;x['time']['min']&nbsp;=&nbsp;10;&nbsp;x['temp']&nbsp;=&nbsp;98.25<br>
&gt;&gt;&gt;&nbsp;x<br>
<a href="#-array">array</a>([((10,&nbsp;0),&nbsp;98.25)],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('time',&nbsp;[('min',&nbsp;'&lt;i4'),&nbsp;('sec',&nbsp;'&lt;i4')]),&nbsp;('temp',&nbsp;'&lt;f8')])<br>
&nbsp;<br>
Save&nbsp;the&nbsp;raw&nbsp;data&nbsp;to&nbsp;disk:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;os<br>
&gt;&gt;&gt;&nbsp;fname&nbsp;=&nbsp;os.tmpnam()<br>
&gt;&gt;&gt;&nbsp;x.tofile(fname)<br>
&nbsp;<br>
Read&nbsp;the&nbsp;raw&nbsp;data&nbsp;from&nbsp;disk:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-fromfile">fromfile</a>(fname,&nbsp;dtype=dt)<br>
<a href="#-array">array</a>([((10,&nbsp;0),&nbsp;98.25)],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('time',&nbsp;[('min',&nbsp;'&lt;i4'),&nbsp;('sec',&nbsp;'&lt;i4')]),&nbsp;('temp',&nbsp;'&lt;f8')])<br>
&nbsp;<br>
The&nbsp;recommended&nbsp;way&nbsp;to&nbsp;store&nbsp;and&nbsp;load&nbsp;data:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.save(fname,&nbsp;x)<br>
&gt;&gt;&gt;&nbsp;np.load(fname&nbsp;+&nbsp;'.npy')<br>
<a href="#-array">array</a>([((10,&nbsp;0),&nbsp;98.25)],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('time',&nbsp;[('min',&nbsp;'&lt;i4'),&nbsp;('sec',&nbsp;'&lt;i4')]),&nbsp;('temp',&nbsp;'&lt;f8')])</tt></dd></dl>
 <dl><dt><a name="-fromiter"><strong>fromiter</strong></a>(...)</dt><dd><tt><a href="#-fromiter">fromiter</a>(iterable,&nbsp;dtype,&nbsp;count=-1)<br>
&nbsp;<br>
Create&nbsp;a&nbsp;new&nbsp;1-dimensional&nbsp;array&nbsp;from&nbsp;an&nbsp;iterable&nbsp;object.<br>
&nbsp;<br>
Parameters<br>
----------<br>
iterable&nbsp;:&nbsp;iterable&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;iterable&nbsp;object&nbsp;providing&nbsp;data&nbsp;for&nbsp;the&nbsp;array.<br>
dtype&nbsp;:&nbsp;data-type<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data-type&nbsp;of&nbsp;the&nbsp;returned&nbsp;array.<br>
count&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;items&nbsp;to&nbsp;read&nbsp;from&nbsp;*iterable*.&nbsp;&nbsp;The&nbsp;default&nbsp;is&nbsp;-1,<br>
&nbsp;&nbsp;&nbsp;&nbsp;which&nbsp;means&nbsp;all&nbsp;data&nbsp;is&nbsp;read.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;output&nbsp;array.<br>
&nbsp;<br>
Notes<br>
-----<br>
Specify&nbsp;`count`&nbsp;to&nbsp;improve&nbsp;performance.&nbsp;&nbsp;It&nbsp;allows&nbsp;``fromiter``&nbsp;to<br>
pre-allocate&nbsp;the&nbsp;output&nbsp;array,&nbsp;instead&nbsp;of&nbsp;resizing&nbsp;it&nbsp;on&nbsp;demand.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;iterable&nbsp;=&nbsp;(x*x&nbsp;for&nbsp;x&nbsp;in&nbsp;range(5))<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-fromiter">fromiter</a>(iterable,&nbsp;np.float)<br>
<a href="#-array">array</a>([&nbsp;&nbsp;0.,&nbsp;&nbsp;&nbsp;1.,&nbsp;&nbsp;&nbsp;4.,&nbsp;&nbsp;&nbsp;9.,&nbsp;&nbsp;16.])</tt></dd></dl>
 <dl><dt><a name="-frompyfunc"><strong>frompyfunc</strong></a>(...)</dt><dd><tt><a href="#-frompyfunc">frompyfunc</a>(func,&nbsp;nin,&nbsp;nout)<br>
&nbsp;<br>
Takes&nbsp;an&nbsp;arbitrary&nbsp;Python&nbsp;function&nbsp;and&nbsp;returns&nbsp;a&nbsp;Numpy&nbsp;ufunc.<br>
&nbsp;<br>
Can&nbsp;be&nbsp;used,&nbsp;for&nbsp;example,&nbsp;to&nbsp;add&nbsp;broadcasting&nbsp;to&nbsp;a&nbsp;built-in&nbsp;Python<br>
function&nbsp;(see&nbsp;Examples&nbsp;section).<br>
&nbsp;<br>
Parameters<br>
----------<br>
func&nbsp;:&nbsp;Python&nbsp;function&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;arbitrary&nbsp;Python&nbsp;function.<br>
nin&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;input&nbsp;arguments.<br>
nout&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;objects&nbsp;returned&nbsp;by&nbsp;`func`.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ufunc<br>
&nbsp;&nbsp;&nbsp;&nbsp;Returns&nbsp;a&nbsp;Numpy&nbsp;universal&nbsp;function&nbsp;(``ufunc``)&nbsp;object.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;returned&nbsp;ufunc&nbsp;always&nbsp;returns&nbsp;PyObject&nbsp;arrays.<br>
&nbsp;<br>
Examples<br>
--------<br>
Use&nbsp;frompyfunc&nbsp;to&nbsp;add&nbsp;broadcasting&nbsp;to&nbsp;the&nbsp;Python&nbsp;function&nbsp;``oct``:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;oct_array&nbsp;=&nbsp;np.<a href="#-frompyfunc">frompyfunc</a>(oct,&nbsp;1,&nbsp;1)<br>
&gt;&gt;&gt;&nbsp;oct_array(np.<a href="#-array">array</a>((10,&nbsp;30,&nbsp;100)))<br>
<a href="#-array">array</a>([012,&nbsp;036,&nbsp;0144],&nbsp;dtype=object)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-array">array</a>((oct(10),&nbsp;oct(30),&nbsp;oct(100)))&nbsp;#&nbsp;for&nbsp;comparison<br>
<a href="#-array">array</a>(['012',&nbsp;'036',&nbsp;'0144'],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype='|S4')</tt></dd></dl>
 <dl><dt><a name="-fromstring"><strong>fromstring</strong></a>(...)</dt><dd><tt><a href="#-fromstring">fromstring</a>(string,&nbsp;dtype=float,&nbsp;count=-1,&nbsp;sep='')<br>
&nbsp;<br>
A&nbsp;new&nbsp;1-D&nbsp;array&nbsp;initialized&nbsp;from&nbsp;raw&nbsp;binary&nbsp;or&nbsp;text&nbsp;data&nbsp;in&nbsp;a&nbsp;string.<br>
&nbsp;<br>
Parameters<br>
----------<br>
string&nbsp;:&nbsp;str<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;string&nbsp;containing&nbsp;the&nbsp;data.<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;data&nbsp;type&nbsp;of&nbsp;the&nbsp;array;&nbsp;default:&nbsp;float.&nbsp;&nbsp;For&nbsp;binary&nbsp;input&nbsp;data,<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;data&nbsp;must&nbsp;be&nbsp;in&nbsp;exactly&nbsp;this&nbsp;format.<br>
count&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Read&nbsp;this&nbsp;number&nbsp;of&nbsp;`dtype`&nbsp;elements&nbsp;from&nbsp;the&nbsp;data.&nbsp;&nbsp;If&nbsp;this&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;negative&nbsp;(the&nbsp;default),&nbsp;the&nbsp;count&nbsp;will&nbsp;be&nbsp;determined&nbsp;from&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;length&nbsp;of&nbsp;the&nbsp;data.<br>
sep&nbsp;:&nbsp;str,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;not&nbsp;provided&nbsp;or,&nbsp;equivalently,&nbsp;the&nbsp;empty&nbsp;string,&nbsp;the&nbsp;data&nbsp;will<br>
&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;interpreted&nbsp;as&nbsp;binary&nbsp;data;&nbsp;otherwise,&nbsp;as&nbsp;ASCII&nbsp;text&nbsp;with<br>
&nbsp;&nbsp;&nbsp;&nbsp;decimal&nbsp;numbers.&nbsp;&nbsp;Also&nbsp;in&nbsp;this&nbsp;latter&nbsp;case,&nbsp;this&nbsp;argument&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;interpreted&nbsp;as&nbsp;the&nbsp;string&nbsp;separating&nbsp;numbers&nbsp;in&nbsp;the&nbsp;data;&nbsp;extra<br>
&nbsp;&nbsp;&nbsp;&nbsp;whitespace&nbsp;between&nbsp;elements&nbsp;is&nbsp;also&nbsp;ignored.<br>
&nbsp;<br>
Returns<br>
-------<br>
arr&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;constructed&nbsp;array.<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;string&nbsp;is&nbsp;not&nbsp;the&nbsp;correct&nbsp;size&nbsp;to&nbsp;satisfy&nbsp;the&nbsp;requested<br>
&nbsp;&nbsp;&nbsp;&nbsp;`dtype`&nbsp;and&nbsp;`count`.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
frombuffer,&nbsp;fromfile,&nbsp;fromiter<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-fromstring">fromstring</a>('\x01\x02',&nbsp;dtype=np.uint8)<br>
<a href="#-array">array</a>([1,&nbsp;2],&nbsp;dtype=uint8)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-fromstring">fromstring</a>('1&nbsp;2',&nbsp;dtype=int,&nbsp;sep='&nbsp;')<br>
<a href="#-array">array</a>([1,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-fromstring">fromstring</a>('1,&nbsp;2',&nbsp;dtype=int,&nbsp;sep=',')<br>
<a href="#-array">array</a>([1,&nbsp;2])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-fromstring">fromstring</a>('\x01\x02\x03\x04\x05',&nbsp;dtype=np.uint8,&nbsp;count=3)<br>
<a href="#-array">array</a>([1,&nbsp;2,&nbsp;3],&nbsp;dtype=uint8)</tt></dd></dl>
 <dl><dt><a name="-gamma"><strong>gamma</strong></a>(...)</dt><dd><tt><a href="#-gamma">gamma</a>(shape,&nbsp;scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Gamma&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Gamma&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;parameters,<br>
`shape`&nbsp;(sometimes&nbsp;designated&nbsp;"k")&nbsp;and&nbsp;`scale`&nbsp;(sometimes&nbsp;designated<br>
"theta"),&nbsp;where&nbsp;both&nbsp;parameters&nbsp;are&nbsp;&gt;&nbsp;0.<br>
&nbsp;<br>
Parameters<br>
----------<br>
shape&nbsp;:&nbsp;scalar&nbsp;&gt;&nbsp;0<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;shape&nbsp;of&nbsp;the&nbsp;gamma&nbsp;distribution.<br>
scale&nbsp;:&nbsp;scalar&nbsp;&gt;&nbsp;0,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;scale&nbsp;of&nbsp;the&nbsp;gamma&nbsp;distribution.&nbsp;&nbsp;Default&nbsp;is&nbsp;equal&nbsp;to&nbsp;1.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray,&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Returns&nbsp;one&nbsp;sample&nbsp;unless&nbsp;`size`&nbsp;parameter&nbsp;is&nbsp;specified.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.gamma&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Gamma&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;x^{k-1}\frac{e^{-x/\theta}}{\theta^k\Gamma(k)},<br>
&nbsp;<br>
where&nbsp;:math:`k`&nbsp;is&nbsp;the&nbsp;shape&nbsp;and&nbsp;:math:`\theta`&nbsp;the&nbsp;scale,<br>
and&nbsp;:math:`\Gamma`&nbsp;is&nbsp;the&nbsp;Gamma&nbsp;function.<br>
&nbsp;<br>
The&nbsp;Gamma&nbsp;distribution&nbsp;is&nbsp;often&nbsp;used&nbsp;to&nbsp;model&nbsp;the&nbsp;times&nbsp;to&nbsp;failure&nbsp;of<br>
electronic&nbsp;components,&nbsp;and&nbsp;arises&nbsp;naturally&nbsp;in&nbsp;processes&nbsp;for&nbsp;which&nbsp;the<br>
waiting&nbsp;times&nbsp;between&nbsp;Poisson&nbsp;distributed&nbsp;events&nbsp;are&nbsp;relevant.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Gamma&nbsp;Distribution."&nbsp;From&nbsp;MathWorld--A<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/GammaDistribution.html">http://mathworld.wolfram.com/GammaDistribution.html</a><br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Gamma-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Gamma-distribution">http://en.wikipedia.org/wiki/Gamma-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;shape,&nbsp;scale&nbsp;=&nbsp;2.,&nbsp;2.&nbsp;#&nbsp;mean&nbsp;and&nbsp;dispersion<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-gamma">gamma</a>(shape,&nbsp;scale,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;import&nbsp;scipy.special&nbsp;as&nbsp;sps<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;bins**(shape-1)*(np.exp(-bins/scale)&nbsp;/<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sps.<a href="#-gamma">gamma</a>(shape)*scale**shape))<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;y,&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-geometric"><strong>geometric</strong></a>(...)</dt><dd><tt><a href="#-geometric">geometric</a>(p,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;geometric&nbsp;distribution.<br>
&nbsp;<br>
Bernoulli&nbsp;trials&nbsp;are&nbsp;experiments&nbsp;with&nbsp;one&nbsp;of&nbsp;two&nbsp;outcomes:<br>
success&nbsp;or&nbsp;failure&nbsp;(an&nbsp;example&nbsp;of&nbsp;such&nbsp;an&nbsp;experiment&nbsp;is&nbsp;flipping<br>
a&nbsp;coin).&nbsp;&nbsp;The&nbsp;geometric&nbsp;distribution&nbsp;models&nbsp;the&nbsp;number&nbsp;of&nbsp;trials<br>
that&nbsp;must&nbsp;be&nbsp;run&nbsp;in&nbsp;order&nbsp;to&nbsp;achieve&nbsp;success.&nbsp;&nbsp;It&nbsp;is&nbsp;therefore<br>
supported&nbsp;on&nbsp;the&nbsp;positive&nbsp;integers,&nbsp;``k&nbsp;=&nbsp;1,&nbsp;2,&nbsp;...``.<br>
&nbsp;<br>
The&nbsp;probability&nbsp;mass&nbsp;function&nbsp;of&nbsp;the&nbsp;geometric&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;<a href="#-f">f</a>(k)&nbsp;=&nbsp;(1&nbsp;-&nbsp;p)^{k&nbsp;-&nbsp;1}&nbsp;p<br>
&nbsp;<br>
where&nbsp;`p`&nbsp;is&nbsp;the&nbsp;probability&nbsp;of&nbsp;success&nbsp;of&nbsp;an&nbsp;individual&nbsp;trial.<br>
&nbsp;<br>
Parameters<br>
----------<br>
p&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;probability&nbsp;of&nbsp;success&nbsp;of&nbsp;an&nbsp;individual&nbsp;trial.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Samples&nbsp;from&nbsp;the&nbsp;geometric&nbsp;distribution,&nbsp;shaped&nbsp;according&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;`size`.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;ten&nbsp;thousand&nbsp;values&nbsp;from&nbsp;the&nbsp;geometric&nbsp;distribution,<br>
with&nbsp;the&nbsp;probability&nbsp;of&nbsp;an&nbsp;individual&nbsp;success&nbsp;equal&nbsp;to&nbsp;0.35:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;z&nbsp;=&nbsp;np.random.<a href="#-geometric">geometric</a>(p=0.35,&nbsp;size=10000)<br>
&nbsp;<br>
How&nbsp;many&nbsp;trials&nbsp;succeeded&nbsp;after&nbsp;a&nbsp;single&nbsp;run?<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;(z&nbsp;==&nbsp;1).sum()&nbsp;/&nbsp;10000.<br>
0.34889999999999999&nbsp;#random</tt></dd></dl>
 <dl><dt><a name="-get_state"><strong>get_state</strong></a>(...)</dt><dd><tt><a href="#-get_state">get_state</a>()<br>
&nbsp;<br>
Return&nbsp;a&nbsp;tuple&nbsp;representing&nbsp;the&nbsp;internal&nbsp;state&nbsp;of&nbsp;the&nbsp;generator.<br>
&nbsp;<br>
For&nbsp;more&nbsp;details,&nbsp;see&nbsp;`set_state`.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;tuple(str,&nbsp;ndarray&nbsp;of&nbsp;624&nbsp;uints,&nbsp;int,&nbsp;int,&nbsp;float)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;returned&nbsp;tuple&nbsp;has&nbsp;the&nbsp;following&nbsp;items:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;the&nbsp;string&nbsp;'MT19937'.<br>
&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;a&nbsp;1-D&nbsp;array&nbsp;of&nbsp;624&nbsp;unsigned&nbsp;integer&nbsp;keys.<br>
&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;an&nbsp;integer&nbsp;``pos``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;an&nbsp;integer&nbsp;``has_gauss``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;a&nbsp;float&nbsp;``cached_gaussian``.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
set_state<br>
&nbsp;<br>
Notes<br>
-----<br>
`set_state`&nbsp;and&nbsp;`get_state`&nbsp;are&nbsp;not&nbsp;needed&nbsp;to&nbsp;work&nbsp;with&nbsp;any&nbsp;of&nbsp;the<br>
random&nbsp;distributions&nbsp;in&nbsp;NumPy.&nbsp;If&nbsp;the&nbsp;internal&nbsp;state&nbsp;is&nbsp;manually&nbsp;altered,<br>
the&nbsp;user&nbsp;should&nbsp;know&nbsp;exactly&nbsp;what&nbsp;he/she&nbsp;is&nbsp;doing.</tt></dd></dl>
 <dl><dt><a name="-getbuffer"><strong>getbuffer</strong></a>(...)</dt><dd><tt><a href="#-getbuffer">getbuffer</a>(obj&nbsp;[,offset[,&nbsp;size]])<br>
&nbsp;<br>
Create&nbsp;a&nbsp;buffer&nbsp;object&nbsp;from&nbsp;the&nbsp;given&nbsp;object&nbsp;referencing&nbsp;a&nbsp;slice&nbsp;of<br>
length&nbsp;size&nbsp;starting&nbsp;at&nbsp;offset.<br>
&nbsp;<br>
Default&nbsp;is&nbsp;the&nbsp;entire&nbsp;buffer.&nbsp;A&nbsp;read-write&nbsp;buffer&nbsp;is&nbsp;attempted&nbsp;followed<br>
by&nbsp;a&nbsp;read-only&nbsp;buffer.<br>
&nbsp;<br>
Parameters<br>
----------<br>
obj&nbsp;:&nbsp;object<br>
&nbsp;<br>
offset&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;<br>
size&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;<br>
Returns<br>
-------<br>
buffer_obj&nbsp;:&nbsp;buffer<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;buf&nbsp;=&nbsp;np.<a href="#-getbuffer">getbuffer</a>(np.ones(5),&nbsp;1,&nbsp;3)<br>
&gt;&gt;&gt;&nbsp;len(buf)<br>
3<br>
&gt;&gt;&gt;&nbsp;buf[0]<br>
'\x00'<br>
&gt;&gt;&gt;&nbsp;buf<br>
&lt;read-write&nbsp;buffer&nbsp;for&nbsp;0x8af1e70,&nbsp;size&nbsp;3,&nbsp;offset&nbsp;1&nbsp;at&nbsp;0x8ba4ec0&gt;</tt></dd></dl>
 <dl><dt><a name="-geterrobj"><strong>geterrobj</strong></a>(...)</dt><dd><tt><a href="#-geterrobj">geterrobj</a>()<br>
&nbsp;<br>
Return&nbsp;the&nbsp;current&nbsp;object&nbsp;that&nbsp;defines&nbsp;floating-point&nbsp;error&nbsp;handling.<br>
&nbsp;<br>
The&nbsp;error&nbsp;object&nbsp;contains&nbsp;all&nbsp;information&nbsp;that&nbsp;defines&nbsp;the&nbsp;error&nbsp;handling<br>
behavior&nbsp;in&nbsp;Numpy.&nbsp;`geterrobj`&nbsp;is&nbsp;used&nbsp;internally&nbsp;by&nbsp;the&nbsp;other<br>
functions&nbsp;that&nbsp;get&nbsp;and&nbsp;set&nbsp;error&nbsp;handling&nbsp;behavior&nbsp;(`geterr`,&nbsp;`seterr`,<br>
`geterrcall`,&nbsp;`seterrcall`).<br>
&nbsp;<br>
Returns<br>
-------<br>
errobj&nbsp;:&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;error&nbsp;object,&nbsp;a&nbsp;list&nbsp;containing&nbsp;three&nbsp;elements:<br>
&nbsp;&nbsp;&nbsp;&nbsp;[internal&nbsp;numpy&nbsp;buffer&nbsp;size,&nbsp;error&nbsp;mask,&nbsp;error&nbsp;callback&nbsp;function].<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;error&nbsp;mask&nbsp;is&nbsp;a&nbsp;single&nbsp;integer&nbsp;that&nbsp;holds&nbsp;the&nbsp;treatment&nbsp;information<br>
&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;all&nbsp;four&nbsp;floating&nbsp;point&nbsp;errors.&nbsp;The&nbsp;information&nbsp;for&nbsp;each&nbsp;error&nbsp;type<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;contained&nbsp;in&nbsp;three&nbsp;bits&nbsp;of&nbsp;the&nbsp;integer.&nbsp;If&nbsp;we&nbsp;print&nbsp;it&nbsp;in&nbsp;base&nbsp;8,&nbsp;we<br>
&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;see&nbsp;what&nbsp;treatment&nbsp;is&nbsp;set&nbsp;for&nbsp;"invalid",&nbsp;"under",&nbsp;"over",&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;"divide"&nbsp;(in&nbsp;that&nbsp;order).&nbsp;The&nbsp;printed&nbsp;string&nbsp;can&nbsp;be&nbsp;interpreted&nbsp;with<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;0&nbsp;:&nbsp;'ignore'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;1&nbsp;:&nbsp;'warn'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;2&nbsp;:&nbsp;'raise'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;3&nbsp;:&nbsp;'call'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;4&nbsp;:&nbsp;'print'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;5&nbsp;:&nbsp;'log'<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
seterrobj,&nbsp;seterr,&nbsp;geterr,&nbsp;seterrcall,&nbsp;geterrcall<br>
getbufsize,&nbsp;setbufsize<br>
&nbsp;<br>
Notes<br>
-----<br>
For&nbsp;complete&nbsp;documentation&nbsp;of&nbsp;the&nbsp;types&nbsp;of&nbsp;floating-point&nbsp;exceptions&nbsp;and<br>
treatment&nbsp;options,&nbsp;see&nbsp;`seterr`.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-geterrobj">geterrobj</a>()&nbsp;&nbsp;#&nbsp;first&nbsp;get&nbsp;the&nbsp;defaults<br>
[10000,&nbsp;0,&nbsp;None]<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;def&nbsp;err_handler(type,&nbsp;flag):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;"Floating&nbsp;point&nbsp;error&nbsp;(%s),&nbsp;with&nbsp;flag&nbsp;%s"&nbsp;%&nbsp;(type,&nbsp;flag)<br>
...<br>
&gt;&gt;&gt;&nbsp;old_bufsize&nbsp;=&nbsp;np.setbufsize(20000)<br>
&gt;&gt;&gt;&nbsp;old_err&nbsp;=&nbsp;np.seterr(divide='raise')<br>
&gt;&gt;&gt;&nbsp;old_handler&nbsp;=&nbsp;np.seterrcall(err_handler)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-geterrobj">geterrobj</a>()<br>
[20000,&nbsp;2,&nbsp;&lt;function&nbsp;err_handler&nbsp;at&nbsp;0x91dcaac&gt;]<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;old_err&nbsp;=&nbsp;np.seterr(all='ignore')<br>
&gt;&gt;&gt;&nbsp;np.base_repr(np.<a href="#-geterrobj">geterrobj</a>()[1],&nbsp;8)<br>
'0'<br>
&gt;&gt;&gt;&nbsp;old_err&nbsp;=&nbsp;np.seterr(divide='warn',&nbsp;over='log',&nbsp;under='call',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;invalid='print')<br>
&gt;&gt;&gt;&nbsp;np.base_repr(np.<a href="#-geterrobj">geterrobj</a>()[1],&nbsp;8)<br>
'4351'</tt></dd></dl>
 <dl><dt><a name="-gumbel"><strong>gumbel</strong></a>(...)</dt><dd><tt><a href="#-gumbel">gumbel</a>(loc=0.0,&nbsp;scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Gumbel&nbsp;distribution.<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Gumbel&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;location&nbsp;and&nbsp;scale.<br>
For&nbsp;more&nbsp;information&nbsp;on&nbsp;the&nbsp;Gumbel&nbsp;distribution,&nbsp;see&nbsp;Notes&nbsp;and&nbsp;References<br>
below.<br>
&nbsp;<br>
Parameters<br>
----------<br>
loc&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;location&nbsp;of&nbsp;the&nbsp;mode&nbsp;of&nbsp;the&nbsp;distribution.<br>
scale&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;scale&nbsp;parameter&nbsp;of&nbsp;the&nbsp;distribution.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;samples<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.gumbel_l<br>
scipy.stats.gumbel_r<br>
scipy.stats.genextreme<br>
&nbsp;&nbsp;&nbsp;&nbsp;probability&nbsp;density&nbsp;function,&nbsp;distribution,&nbsp;or&nbsp;cumulative&nbsp;density<br>
&nbsp;&nbsp;&nbsp;&nbsp;function,&nbsp;etc.&nbsp;for&nbsp;each&nbsp;of&nbsp;the&nbsp;above<br>
weibull<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;Gumbel&nbsp;(or&nbsp;Smallest&nbsp;Extreme&nbsp;Value&nbsp;(SEV)&nbsp;or&nbsp;the&nbsp;Smallest&nbsp;Extreme&nbsp;Value<br>
Type&nbsp;I)&nbsp;distribution&nbsp;is&nbsp;one&nbsp;of&nbsp;a&nbsp;class&nbsp;of&nbsp;Generalized&nbsp;Extreme&nbsp;Value&nbsp;(GEV)<br>
distributions&nbsp;used&nbsp;in&nbsp;modeling&nbsp;extreme&nbsp;value&nbsp;problems.&nbsp;&nbsp;The&nbsp;Gumbel&nbsp;is&nbsp;a<br>
special&nbsp;case&nbsp;of&nbsp;the&nbsp;Extreme&nbsp;Value&nbsp;Type&nbsp;I&nbsp;distribution&nbsp;for&nbsp;maximums&nbsp;from<br>
distributions&nbsp;with&nbsp;"exponential-like"&nbsp;tails.<br>
&nbsp;<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Gumbel&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{e^{-(x&nbsp;-&nbsp;\mu)/&nbsp;\beta}}{\beta}&nbsp;e^{&nbsp;-e^{-(x&nbsp;-&nbsp;\mu)/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\beta}},<br>
&nbsp;<br>
where&nbsp;:math:`\mu`&nbsp;is&nbsp;the&nbsp;mode,&nbsp;a&nbsp;location&nbsp;parameter,&nbsp;and&nbsp;:math:`\beta`&nbsp;is<br>
the&nbsp;scale&nbsp;parameter.<br>
&nbsp;<br>
The&nbsp;Gumbel&nbsp;(named&nbsp;for&nbsp;German&nbsp;mathematician&nbsp;Emil&nbsp;Julius&nbsp;Gumbel)&nbsp;was&nbsp;used<br>
very&nbsp;early&nbsp;in&nbsp;the&nbsp;hydrology&nbsp;literature,&nbsp;for&nbsp;modeling&nbsp;the&nbsp;occurrence&nbsp;of<br>
flood&nbsp;events.&nbsp;It&nbsp;is&nbsp;also&nbsp;used&nbsp;for&nbsp;modeling&nbsp;maximum&nbsp;wind&nbsp;speed&nbsp;and&nbsp;rainfall<br>
rates.&nbsp;&nbsp;It&nbsp;is&nbsp;a&nbsp;"fat-tailed"&nbsp;distribution&nbsp;-&nbsp;the&nbsp;probability&nbsp;of&nbsp;an&nbsp;event&nbsp;in<br>
the&nbsp;tail&nbsp;of&nbsp;the&nbsp;distribution&nbsp;is&nbsp;larger&nbsp;than&nbsp;if&nbsp;one&nbsp;used&nbsp;a&nbsp;Gaussian,&nbsp;hence<br>
the&nbsp;surprisingly&nbsp;frequent&nbsp;occurrence&nbsp;of&nbsp;100-year&nbsp;floods.&nbsp;Floods&nbsp;were<br>
initially&nbsp;modeled&nbsp;as&nbsp;a&nbsp;Gaussian&nbsp;process,&nbsp;which&nbsp;underestimated&nbsp;the&nbsp;frequency<br>
of&nbsp;extreme&nbsp;events.<br>
&nbsp;<br>
&nbsp;<br>
It&nbsp;is&nbsp;one&nbsp;of&nbsp;a&nbsp;class&nbsp;of&nbsp;extreme&nbsp;value&nbsp;distributions,&nbsp;the&nbsp;Generalized<br>
Extreme&nbsp;Value&nbsp;(GEV)&nbsp;distributions,&nbsp;which&nbsp;also&nbsp;includes&nbsp;the&nbsp;Weibull&nbsp;and<br>
Frechet.<br>
&nbsp;<br>
The&nbsp;function&nbsp;has&nbsp;a&nbsp;mean&nbsp;of&nbsp;:math:`\mu&nbsp;+&nbsp;0.57721\beta`&nbsp;and&nbsp;a&nbsp;variance&nbsp;of<br>
:math:`\frac{\pi^2}{6}\beta^2`.<br>
&nbsp;<br>
References<br>
----------<br>
Gumbel,&nbsp;E.&nbsp;J.,&nbsp;*Statistics&nbsp;of&nbsp;Extremes*,&nbsp;New&nbsp;York:&nbsp;Columbia&nbsp;University<br>
Press,&nbsp;1958.<br>
&nbsp;<br>
Reiss,&nbsp;R.-D.&nbsp;and&nbsp;Thomas,&nbsp;M.,&nbsp;*Statistical&nbsp;Analysis&nbsp;of&nbsp;Extreme&nbsp;Values&nbsp;from<br>
Insurance,&nbsp;Finance,&nbsp;Hydrology&nbsp;and&nbsp;Other&nbsp;Fields*,&nbsp;Basel:&nbsp;Birkhauser&nbsp;Verlag,<br>
2001.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;mu,&nbsp;beta&nbsp;=&nbsp;0,&nbsp;0.1&nbsp;#&nbsp;location&nbsp;and&nbsp;scale<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-gumbel">gumbel</a>(mu,&nbsp;beta,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;30,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;(1/beta)*np.exp(-(bins&nbsp;-&nbsp;mu)/beta)<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;np.exp(&nbsp;-np.exp(&nbsp;-(bins&nbsp;-&nbsp;mu)&nbsp;/beta)&nbsp;),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()<br>
&nbsp;<br>
Show&nbsp;how&nbsp;an&nbsp;extreme&nbsp;value&nbsp;distribution&nbsp;can&nbsp;arise&nbsp;from&nbsp;a&nbsp;Gaussian&nbsp;process<br>
and&nbsp;compare&nbsp;to&nbsp;a&nbsp;Gaussian:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;means&nbsp;=&nbsp;[]<br>
&gt;&gt;&gt;&nbsp;maxima&nbsp;=&nbsp;[]<br>
&gt;&gt;&gt;&nbsp;for&nbsp;i&nbsp;in&nbsp;range(0,1000)&nbsp;:<br>
...&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;np.random.<a href="#-normal">normal</a>(mu,&nbsp;beta,&nbsp;1000)<br>
...&nbsp;&nbsp;&nbsp;&nbsp;means.append(a.mean())<br>
...&nbsp;&nbsp;&nbsp;&nbsp;maxima.append(a.max())<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(maxima,&nbsp;30,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;beta&nbsp;=&nbsp;np.std(maxima)*np.pi/np.sqrt(6)<br>
&gt;&gt;&gt;&nbsp;mu&nbsp;=&nbsp;np.mean(maxima)&nbsp;-&nbsp;0.57721*beta<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;(1/beta)*np.exp(-(bins&nbsp;-&nbsp;mu)/beta)<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;np.exp(-np.exp(-(bins&nbsp;-&nbsp;mu)/beta)),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;1/(beta&nbsp;*&nbsp;np.sqrt(2&nbsp;*&nbsp;np.pi))<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;np.exp(-(bins&nbsp;-&nbsp;mu)**2&nbsp;/&nbsp;(2&nbsp;*&nbsp;beta**2)),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linewidth=2,&nbsp;color='g')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-hypergeometric"><strong>hypergeometric</strong></a>(...)</dt><dd><tt><a href="#-hypergeometric">hypergeometric</a>(ngood,&nbsp;nbad,&nbsp;nsample,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Hypergeometric&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Hypergeometric&nbsp;distribution&nbsp;with&nbsp;specified<br>
parameters,&nbsp;ngood&nbsp;(ways&nbsp;to&nbsp;make&nbsp;a&nbsp;good&nbsp;selection),&nbsp;nbad&nbsp;(ways&nbsp;to&nbsp;make<br>
a&nbsp;bad&nbsp;selection),&nbsp;and&nbsp;nsample&nbsp;=&nbsp;number&nbsp;of&nbsp;items&nbsp;sampled,&nbsp;which&nbsp;is&nbsp;less<br>
than&nbsp;or&nbsp;equal&nbsp;to&nbsp;the&nbsp;sum&nbsp;ngood&nbsp;+&nbsp;nbad.<br>
&nbsp;<br>
Parameters<br>
----------<br>
ngood&nbsp;:&nbsp;int&nbsp;or&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;ways&nbsp;to&nbsp;make&nbsp;a&nbsp;good&nbsp;selection.&nbsp;&nbsp;Must&nbsp;be&nbsp;nonnegative.<br>
nbad&nbsp;:&nbsp;int&nbsp;or&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;ways&nbsp;to&nbsp;make&nbsp;a&nbsp;bad&nbsp;selection.&nbsp;&nbsp;Must&nbsp;be&nbsp;nonnegative.<br>
nsample&nbsp;:&nbsp;int&nbsp;or&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;items&nbsp;sampled.&nbsp;&nbsp;Must&nbsp;be&nbsp;at&nbsp;least&nbsp;1&nbsp;and&nbsp;at&nbsp;most<br>
&nbsp;&nbsp;&nbsp;&nbsp;``ngood&nbsp;+&nbsp;nbad``.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;values&nbsp;are&nbsp;all&nbsp;integers&nbsp;in&nbsp;&nbsp;[0,&nbsp;n].<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.hypergeom&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Hypergeometric&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x)&nbsp;=&nbsp;\frac{\binom{m}{n}\binom{N-m}{n-x}}{\binom{N}{n}},<br>
&nbsp;<br>
where&nbsp;:math:`0&nbsp;\le&nbsp;x&nbsp;\le&nbsp;m`&nbsp;and&nbsp;:math:`n+m-N&nbsp;\le&nbsp;x&nbsp;\le&nbsp;n`<br>
&nbsp;<br>
for&nbsp;P(x)&nbsp;the&nbsp;probability&nbsp;of&nbsp;x&nbsp;successes,&nbsp;n&nbsp;=&nbsp;ngood,&nbsp;m&nbsp;=&nbsp;nbad,&nbsp;and<br>
N&nbsp;=&nbsp;number&nbsp;of&nbsp;samples.<br>
&nbsp;<br>
Consider&nbsp;an&nbsp;urn&nbsp;with&nbsp;black&nbsp;and&nbsp;white&nbsp;marbles&nbsp;in&nbsp;it,&nbsp;ngood&nbsp;of&nbsp;them<br>
black&nbsp;and&nbsp;nbad&nbsp;are&nbsp;white.&nbsp;If&nbsp;you&nbsp;draw&nbsp;nsample&nbsp;balls&nbsp;without<br>
replacement,&nbsp;then&nbsp;the&nbsp;Hypergeometric&nbsp;distribution&nbsp;describes&nbsp;the<br>
distribution&nbsp;of&nbsp;black&nbsp;balls&nbsp;in&nbsp;the&nbsp;drawn&nbsp;sample.<br>
&nbsp;<br>
Note&nbsp;that&nbsp;this&nbsp;distribution&nbsp;is&nbsp;very&nbsp;similar&nbsp;to&nbsp;the&nbsp;Binomial<br>
distribution,&nbsp;except&nbsp;that&nbsp;in&nbsp;this&nbsp;case,&nbsp;samples&nbsp;are&nbsp;drawn&nbsp;without<br>
replacement,&nbsp;whereas&nbsp;in&nbsp;the&nbsp;Binomial&nbsp;case&nbsp;samples&nbsp;are&nbsp;drawn&nbsp;with<br>
replacement&nbsp;(or&nbsp;the&nbsp;sample&nbsp;space&nbsp;is&nbsp;infinite).&nbsp;As&nbsp;the&nbsp;sample&nbsp;space<br>
becomes&nbsp;large,&nbsp;this&nbsp;distribution&nbsp;approaches&nbsp;the&nbsp;Binomial.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Lentner,&nbsp;Marvin,&nbsp;"Elementary&nbsp;Applied&nbsp;Statistics",&nbsp;Bogden<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;Quigley,&nbsp;1972.<br>
..&nbsp;[2]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Hypergeometric&nbsp;Distribution."&nbsp;From<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MathWorld--A&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/HypergeometricDistribution.html">http://mathworld.wolfram.com/HypergeometricDistribution.html</a><br>
..&nbsp;[3]&nbsp;Wikipedia,&nbsp;"Hypergeometric-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Hypergeometric-distribution">http://en.wikipedia.org/wiki/Hypergeometric-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;ngood,&nbsp;nbad,&nbsp;nsamp&nbsp;=&nbsp;100,&nbsp;2,&nbsp;10<br>
#&nbsp;number&nbsp;of&nbsp;good,&nbsp;number&nbsp;of&nbsp;bad,&nbsp;and&nbsp;number&nbsp;of&nbsp;samples<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-hypergeometric">hypergeometric</a>(ngood,&nbsp;nbad,&nbsp;nsamp,&nbsp;1000)<br>
&gt;&gt;&gt;&nbsp;hist(s)<br>
#&nbsp;&nbsp;&nbsp;note&nbsp;that&nbsp;it&nbsp;is&nbsp;very&nbsp;unlikely&nbsp;to&nbsp;grab&nbsp;both&nbsp;bad&nbsp;items<br>
&nbsp;<br>
Suppose&nbsp;you&nbsp;have&nbsp;an&nbsp;urn&nbsp;with&nbsp;15&nbsp;white&nbsp;and&nbsp;15&nbsp;black&nbsp;marbles.<br>
If&nbsp;you&nbsp;pull&nbsp;15&nbsp;marbles&nbsp;at&nbsp;random,&nbsp;how&nbsp;likely&nbsp;is&nbsp;it&nbsp;that<br>
12&nbsp;or&nbsp;more&nbsp;of&nbsp;them&nbsp;are&nbsp;one&nbsp;color?<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-hypergeometric">hypergeometric</a>(15,&nbsp;15,&nbsp;15,&nbsp;100000)<br>
&gt;&gt;&gt;&nbsp;sum(s&gt;=12)/100000.&nbsp;+&nbsp;sum(s&lt;=3)/100000.<br>
#&nbsp;&nbsp;&nbsp;answer&nbsp;=&nbsp;0.003&nbsp;...&nbsp;pretty&nbsp;unlikely!</tt></dd></dl>
 <dl><dt><a name="-inner"><strong>inner</strong></a>(...)</dt><dd><tt><a href="#-inner">inner</a>(a,&nbsp;b)<br>
&nbsp;<br>
Inner&nbsp;product&nbsp;of&nbsp;two&nbsp;arrays.<br>
&nbsp;<br>
Ordinary&nbsp;inner&nbsp;product&nbsp;of&nbsp;vectors&nbsp;for&nbsp;1-D&nbsp;arrays&nbsp;(without&nbsp;complex<br>
conjugation),&nbsp;in&nbsp;higher&nbsp;dimensions&nbsp;a&nbsp;sum&nbsp;product&nbsp;over&nbsp;the&nbsp;last&nbsp;axes.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a,&nbsp;b&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`a`&nbsp;and&nbsp;`b`&nbsp;are&nbsp;nonscalar,&nbsp;their&nbsp;last&nbsp;dimensions&nbsp;of&nbsp;must&nbsp;match.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;`out.shape&nbsp;=&nbsp;a.shape[:-1]&nbsp;+&nbsp;b.shape[:-1]`<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;last&nbsp;dimension&nbsp;of&nbsp;`a`&nbsp;and&nbsp;`b`&nbsp;has&nbsp;different&nbsp;size.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
tensordot&nbsp;:&nbsp;Sum&nbsp;products&nbsp;over&nbsp;arbitrary&nbsp;axes.<br>
dot&nbsp;:&nbsp;Generalised&nbsp;matrix&nbsp;product,&nbsp;using&nbsp;second&nbsp;last&nbsp;dimension&nbsp;of&nbsp;`b`.<br>
einsum&nbsp;:&nbsp;Einstein&nbsp;summation&nbsp;convention.<br>
&nbsp;<br>
Notes<br>
-----<br>
For&nbsp;vectors&nbsp;(1-D&nbsp;arrays)&nbsp;it&nbsp;computes&nbsp;the&nbsp;ordinary&nbsp;inner-product::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;np.<a href="#-inner">inner</a>(a,&nbsp;b)&nbsp;=&nbsp;sum(a[:]*b[:])<br>
&nbsp;<br>
More&nbsp;generally,&nbsp;if&nbsp;`ndim(a)&nbsp;=&nbsp;r&nbsp;&gt;&nbsp;0`&nbsp;and&nbsp;`ndim(b)&nbsp;=&nbsp;s&nbsp;&gt;&nbsp;0`::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;np.<a href="#-inner">inner</a>(a,&nbsp;b)&nbsp;=&nbsp;np.tensordot(a,&nbsp;b,&nbsp;axes=(-1,-1))<br>
&nbsp;<br>
or&nbsp;explicitly::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;np.<a href="#-inner">inner</a>(a,&nbsp;b)[i0,...,ir-1,j0,...,js-1]<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;sum(a[i0,...,ir-1,:]*b[j0,...,js-1,:])<br>
&nbsp;<br>
In&nbsp;addition&nbsp;`a`&nbsp;or&nbsp;`b`&nbsp;may&nbsp;be&nbsp;scalars,&nbsp;in&nbsp;which&nbsp;case::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;np.<a href="#-inner">inner</a>(a,b)&nbsp;=&nbsp;a*b<br>
&nbsp;<br>
Examples<br>
--------<br>
Ordinary&nbsp;inner&nbsp;product&nbsp;for&nbsp;vectors:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([1,2,3])<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-array">array</a>([0,1,0])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-inner">inner</a>(a,&nbsp;b)<br>
2<br>
&nbsp;<br>
A&nbsp;multidimensional&nbsp;example:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(24).reshape((2,3,4))<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(4)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-inner">inner</a>(a,&nbsp;b)<br>
<a href="#-array">array</a>([[&nbsp;14,&nbsp;&nbsp;38,&nbsp;&nbsp;62],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;86,&nbsp;110,&nbsp;134]])<br>
&nbsp;<br>
An&nbsp;example&nbsp;where&nbsp;`b`&nbsp;is&nbsp;a&nbsp;scalar:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-inner">inner</a>(np.eye(2),&nbsp;7)<br>
<a href="#-array">array</a>([[&nbsp;7.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;7.]])</tt></dd></dl>
 <dl><dt><a name="-int_asbuffer"><strong>int_asbuffer</strong></a>(...)</dt></dl>
 <dl><dt><a name="-is_busday"><strong>is_busday</strong></a>(...)</dt><dd><tt><a href="#-is_busday">is_busday</a>(dates,&nbsp;weekmask='1111100',&nbsp;holidays=None,&nbsp;busdaycal=None,&nbsp;out=None)<br>
&nbsp;<br>
Calculates&nbsp;which&nbsp;of&nbsp;the&nbsp;given&nbsp;dates&nbsp;are&nbsp;valid&nbsp;days,&nbsp;and&nbsp;which&nbsp;are&nbsp;not.<br>
&nbsp;<br>
..&nbsp;versionadded::&nbsp;1.7.0<br>
&nbsp;<br>
Parameters<br>
----------<br>
dates&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D]<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;of&nbsp;dates&nbsp;to&nbsp;process.<br>
weekmask&nbsp;:&nbsp;str&nbsp;or&nbsp;array_like&nbsp;of&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;seven-element&nbsp;array&nbsp;indicating&nbsp;which&nbsp;of&nbsp;Monday&nbsp;through&nbsp;Sunday&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;valid&nbsp;days.&nbsp;May&nbsp;be&nbsp;specified&nbsp;as&nbsp;a&nbsp;length-seven&nbsp;list&nbsp;or&nbsp;array,&nbsp;like<br>
&nbsp;&nbsp;&nbsp;&nbsp;[1,1,1,1,1,0,0];&nbsp;a&nbsp;length-seven&nbsp;string,&nbsp;like&nbsp;'1111100';&nbsp;or&nbsp;a&nbsp;string<br>
&nbsp;&nbsp;&nbsp;&nbsp;like&nbsp;"Mon&nbsp;Tue&nbsp;Wed&nbsp;Thu&nbsp;Fri",&nbsp;made&nbsp;up&nbsp;of&nbsp;3-character&nbsp;abbreviations&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;weekdays,&nbsp;optionally&nbsp;separated&nbsp;by&nbsp;white&nbsp;space.&nbsp;Valid&nbsp;abbreviations<br>
&nbsp;&nbsp;&nbsp;&nbsp;are:&nbsp;Mon&nbsp;Tue&nbsp;Wed&nbsp;Thu&nbsp;Fri&nbsp;Sat&nbsp;Sun<br>
holidays&nbsp;:&nbsp;array_like&nbsp;of&nbsp;datetime64[D],&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;of&nbsp;dates&nbsp;to&nbsp;consider&nbsp;as&nbsp;invalid&nbsp;dates.&nbsp;&nbsp;They&nbsp;may&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;specified&nbsp;in&nbsp;any&nbsp;order,&nbsp;and&nbsp;NaT&nbsp;(not-a-time)&nbsp;dates&nbsp;are&nbsp;ignored.<br>
&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;list&nbsp;is&nbsp;saved&nbsp;in&nbsp;a&nbsp;normalized&nbsp;form&nbsp;that&nbsp;is&nbsp;suited&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;fast&nbsp;calculations&nbsp;of&nbsp;valid&nbsp;days.<br>
busdaycal&nbsp;:&nbsp;busdaycalendar,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;`busdaycalendar`&nbsp;object&nbsp;which&nbsp;specifies&nbsp;the&nbsp;valid&nbsp;days.&nbsp;If&nbsp;this<br>
&nbsp;&nbsp;&nbsp;&nbsp;parameter&nbsp;is&nbsp;provided,&nbsp;neither&nbsp;weekmask&nbsp;nor&nbsp;holidays&nbsp;may&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;provided.<br>
out&nbsp;:&nbsp;array&nbsp;of&nbsp;bool,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;this&nbsp;array&nbsp;is&nbsp;filled&nbsp;with&nbsp;the&nbsp;result.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;array&nbsp;of&nbsp;bool<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;with&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;``dates``,&nbsp;containing&nbsp;True&nbsp;for<br>
&nbsp;&nbsp;&nbsp;&nbsp;each&nbsp;valid&nbsp;day,&nbsp;and&nbsp;False&nbsp;for&nbsp;each&nbsp;invalid&nbsp;day.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
busdaycalendar:&nbsp;An&nbsp;object&nbsp;that&nbsp;specifies&nbsp;a&nbsp;custom&nbsp;set&nbsp;of&nbsp;valid&nbsp;days.<br>
busday_offset&nbsp;:&nbsp;Applies&nbsp;an&nbsp;offset&nbsp;counted&nbsp;in&nbsp;valid&nbsp;days.<br>
busday_count&nbsp;:&nbsp;Counts&nbsp;how&nbsp;many&nbsp;valid&nbsp;days&nbsp;are&nbsp;in&nbsp;a&nbsp;half-open&nbsp;date&nbsp;range.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;#&nbsp;The&nbsp;weekdays&nbsp;are&nbsp;Friday,&nbsp;Saturday,&nbsp;and&nbsp;Monday<br>
...&nbsp;np.<a href="#-is_busday">is_busday</a>(['2011-07-01',&nbsp;'2011-07-02',&nbsp;'2011-07-18'],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;holidays=['2011-07-01',&nbsp;'2011-07-04',&nbsp;'2011-07-17'])<br>
<a href="#-array">array</a>([False,&nbsp;False,&nbsp;&nbsp;True],&nbsp;dtype='bool')</tt></dd></dl>
 <dl><dt><a name="-laplace"><strong>laplace</strong></a>(...)</dt><dd><tt><a href="#-laplace">laplace</a>(loc=0.0,&nbsp;scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;Laplace&nbsp;or&nbsp;double&nbsp;exponential&nbsp;distribution&nbsp;with<br>
specified&nbsp;location&nbsp;(or&nbsp;mean)&nbsp;and&nbsp;scale&nbsp;(decay).<br>
&nbsp;<br>
The&nbsp;Laplace&nbsp;distribution&nbsp;is&nbsp;similar&nbsp;to&nbsp;the&nbsp;Gaussian/normal&nbsp;distribution,<br>
but&nbsp;is&nbsp;sharper&nbsp;at&nbsp;the&nbsp;peak&nbsp;and&nbsp;has&nbsp;fatter&nbsp;tails.&nbsp;It&nbsp;represents&nbsp;the<br>
difference&nbsp;between&nbsp;two&nbsp;independent,&nbsp;identically&nbsp;distributed&nbsp;exponential<br>
random&nbsp;variables.<br>
&nbsp;<br>
Parameters<br>
----------<br>
loc&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;position,&nbsp;:math:`\mu`,&nbsp;of&nbsp;the&nbsp;distribution&nbsp;peak.<br>
scale&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;:math:`\lambda`,&nbsp;the&nbsp;exponential&nbsp;decay.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Notes<br>
-----<br>
It&nbsp;has&nbsp;the&nbsp;probability&nbsp;density&nbsp;function<br>
&nbsp;<br>
..&nbsp;math::&nbsp;<a href="#-f">f</a>(x;&nbsp;\mu,&nbsp;\lambda)&nbsp;=&nbsp;\frac{1}{2\lambda}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\exp\left(-\frac{|x&nbsp;-&nbsp;\mu|}{\lambda}\right).<br>
&nbsp;<br>
The&nbsp;first&nbsp;law&nbsp;of&nbsp;Laplace,&nbsp;from&nbsp;1774,&nbsp;states&nbsp;that&nbsp;the&nbsp;frequency&nbsp;of&nbsp;an&nbsp;error<br>
can&nbsp;be&nbsp;expressed&nbsp;as&nbsp;an&nbsp;exponential&nbsp;function&nbsp;of&nbsp;the&nbsp;absolute&nbsp;magnitude&nbsp;of<br>
the&nbsp;error,&nbsp;which&nbsp;leads&nbsp;to&nbsp;the&nbsp;Laplace&nbsp;distribution.&nbsp;For&nbsp;many&nbsp;problems&nbsp;in<br>
Economics&nbsp;and&nbsp;Health&nbsp;sciences,&nbsp;this&nbsp;distribution&nbsp;seems&nbsp;to&nbsp;model&nbsp;the&nbsp;data<br>
better&nbsp;than&nbsp;the&nbsp;standard&nbsp;Gaussian&nbsp;distribution<br>
&nbsp;<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Abramowitz,&nbsp;M.&nbsp;and&nbsp;Stegun,&nbsp;I.&nbsp;A.&nbsp;(Eds.).&nbsp;Handbook&nbsp;of&nbsp;Mathematical<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Functions&nbsp;with&nbsp;Formulas,&nbsp;Graphs,&nbsp;and&nbsp;Mathematical&nbsp;Tables,&nbsp;9th<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printing.&nbsp;&nbsp;New&nbsp;York:&nbsp;Dover,&nbsp;1972.<br>
&nbsp;<br>
..&nbsp;[2]&nbsp;The&nbsp;Laplace&nbsp;distribution&nbsp;and&nbsp;generalizations<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;By&nbsp;Samuel&nbsp;Kotz,&nbsp;Tomasz&nbsp;J.&nbsp;Kozubowski,&nbsp;Krzysztof&nbsp;Podgorski,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Birkhauser,&nbsp;2001.<br>
&nbsp;<br>
..&nbsp;[3]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Laplace&nbsp;Distribution."<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;From&nbsp;MathWorld--A&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/LaplaceDistribution.html">http://mathworld.wolfram.com/LaplaceDistribution.html</a><br>
&nbsp;<br>
..&nbsp;[4]&nbsp;Wikipedia,&nbsp;"Laplace&nbsp;distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Laplace_distribution">http://en.wikipedia.org/wiki/Laplace_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;loc,&nbsp;scale&nbsp;=&nbsp;0.,&nbsp;1.<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-laplace">laplace</a>(loc,&nbsp;scale,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;30,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(-8.,&nbsp;8.,&nbsp;.01)<br>
&gt;&gt;&gt;&nbsp;pdf&nbsp;=&nbsp;np.exp(-abs(x-loc)/scale)/(2.*scale)<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;pdf)<br>
&nbsp;<br>
Plot&nbsp;Gaussian&nbsp;for&nbsp;comparison:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;g&nbsp;=&nbsp;(1/(scale&nbsp;*&nbsp;np.sqrt(2&nbsp;*&nbsp;np.pi))&nbsp;*&nbsp;<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;np.exp(-(x&nbsp;-&nbsp;loc)**2&nbsp;/&nbsp;(2&nbsp;*&nbsp;scale**2)))<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,g)</tt></dd></dl>
 <dl><dt><a name="-lexsort"><strong>lexsort</strong></a>(...)</dt><dd><tt><a href="#-lexsort">lexsort</a>(keys,&nbsp;axis=-1)<br>
&nbsp;<br>
Perform&nbsp;an&nbsp;indirect&nbsp;sort&nbsp;using&nbsp;a&nbsp;sequence&nbsp;of&nbsp;keys.<br>
&nbsp;<br>
Given&nbsp;multiple&nbsp;sorting&nbsp;keys,&nbsp;which&nbsp;can&nbsp;be&nbsp;interpreted&nbsp;as&nbsp;columns&nbsp;in&nbsp;a<br>
spreadsheet,&nbsp;lexsort&nbsp;returns&nbsp;an&nbsp;array&nbsp;of&nbsp;integer&nbsp;indices&nbsp;that&nbsp;describes<br>
the&nbsp;sort&nbsp;order&nbsp;by&nbsp;multiple&nbsp;columns.&nbsp;The&nbsp;last&nbsp;key&nbsp;in&nbsp;the&nbsp;sequence&nbsp;is&nbsp;used<br>
for&nbsp;the&nbsp;primary&nbsp;sort&nbsp;order,&nbsp;the&nbsp;second-to-last&nbsp;key&nbsp;for&nbsp;the&nbsp;secondary&nbsp;sort<br>
order,&nbsp;and&nbsp;so&nbsp;on.&nbsp;The&nbsp;keys&nbsp;argument&nbsp;must&nbsp;be&nbsp;a&nbsp;sequence&nbsp;of&nbsp;objects&nbsp;that<br>
can&nbsp;be&nbsp;converted&nbsp;to&nbsp;arrays&nbsp;of&nbsp;the&nbsp;same&nbsp;shape.&nbsp;If&nbsp;a&nbsp;2D&nbsp;array&nbsp;is&nbsp;provided<br>
for&nbsp;the&nbsp;keys&nbsp;argument,&nbsp;it's&nbsp;rows&nbsp;are&nbsp;interpreted&nbsp;as&nbsp;the&nbsp;sorting&nbsp;keys&nbsp;and<br>
sorting&nbsp;is&nbsp;according&nbsp;to&nbsp;the&nbsp;last&nbsp;row,&nbsp;second&nbsp;last&nbsp;row&nbsp;etc.<br>
&nbsp;<br>
Parameters<br>
----------<br>
keys&nbsp;:&nbsp;(k,&nbsp;N)&nbsp;array&nbsp;or&nbsp;tuple&nbsp;containing&nbsp;k&nbsp;(N,)-shaped&nbsp;sequences<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;`k`&nbsp;different&nbsp;"columns"&nbsp;to&nbsp;be&nbsp;sorted.&nbsp;&nbsp;The&nbsp;last&nbsp;column&nbsp;(or&nbsp;row&nbsp;if<br>
&nbsp;&nbsp;&nbsp;&nbsp;`keys`&nbsp;is&nbsp;a&nbsp;2D&nbsp;array)&nbsp;is&nbsp;the&nbsp;primary&nbsp;sort&nbsp;key.<br>
axis&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Axis&nbsp;to&nbsp;be&nbsp;indirectly&nbsp;sorted.&nbsp;&nbsp;By&nbsp;default,&nbsp;sort&nbsp;over&nbsp;the&nbsp;last&nbsp;axis.<br>
&nbsp;<br>
Returns<br>
-------<br>
indices&nbsp;:&nbsp;(N,)&nbsp;ndarray&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;indices&nbsp;that&nbsp;sort&nbsp;the&nbsp;keys&nbsp;along&nbsp;the&nbsp;specified&nbsp;axis.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
argsort&nbsp;:&nbsp;Indirect&nbsp;sort.<br>
ndarray.sort&nbsp;:&nbsp;In-place&nbsp;sort.<br>
sort&nbsp;:&nbsp;Return&nbsp;a&nbsp;sorted&nbsp;copy&nbsp;of&nbsp;an&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
Sort&nbsp;names:&nbsp;first&nbsp;by&nbsp;surname,&nbsp;then&nbsp;by&nbsp;name.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;surnames&nbsp;=&nbsp;&nbsp;&nbsp;&nbsp;('Hertz',&nbsp;&nbsp;&nbsp;&nbsp;'Galilei',&nbsp;'Hertz')<br>
&gt;&gt;&gt;&nbsp;first_names&nbsp;=&nbsp;('Heinrich',&nbsp;'Galileo',&nbsp;'Gustav')<br>
&gt;&gt;&gt;&nbsp;ind&nbsp;=&nbsp;np.<a href="#-lexsort">lexsort</a>((first_names,&nbsp;surnames))<br>
&gt;&gt;&gt;&nbsp;ind<br>
<a href="#-array">array</a>([1,&nbsp;2,&nbsp;0])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;[surnames[i]&nbsp;+&nbsp;",&nbsp;"&nbsp;+&nbsp;first_names[i]&nbsp;for&nbsp;i&nbsp;in&nbsp;ind]<br>
['Galilei,&nbsp;Galileo',&nbsp;'Hertz,&nbsp;Gustav',&nbsp;'Hertz,&nbsp;Heinrich']<br>
&nbsp;<br>
Sort&nbsp;two&nbsp;columns&nbsp;of&nbsp;numbers:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;[1,5,1,4,3,4,4]&nbsp;#&nbsp;First&nbsp;column<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;[9,4,0,4,0,2,1]&nbsp;#&nbsp;Second&nbsp;column<br>
&gt;&gt;&gt;&nbsp;ind&nbsp;=&nbsp;np.<a href="#-lexsort">lexsort</a>((b,a))&nbsp;#&nbsp;Sort&nbsp;by&nbsp;a,&nbsp;then&nbsp;by&nbsp;b<br>
&gt;&gt;&gt;&nbsp;print&nbsp;ind<br>
[2&nbsp;0&nbsp;4&nbsp;6&nbsp;5&nbsp;3&nbsp;1]<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;[(a[i],b[i])&nbsp;for&nbsp;i&nbsp;in&nbsp;ind]<br>
[(1,&nbsp;0),&nbsp;(1,&nbsp;9),&nbsp;(3,&nbsp;0),&nbsp;(4,&nbsp;1),&nbsp;(4,&nbsp;2),&nbsp;(4,&nbsp;4),&nbsp;(5,&nbsp;4)]<br>
&nbsp;<br>
Note&nbsp;that&nbsp;sorting&nbsp;is&nbsp;first&nbsp;according&nbsp;to&nbsp;the&nbsp;elements&nbsp;of&nbsp;``a``.<br>
Secondary&nbsp;sorting&nbsp;is&nbsp;according&nbsp;to&nbsp;the&nbsp;elements&nbsp;of&nbsp;``b``.<br>
&nbsp;<br>
A&nbsp;normal&nbsp;``argsort``&nbsp;would&nbsp;have&nbsp;yielded:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;[(a[i],b[i])&nbsp;for&nbsp;i&nbsp;in&nbsp;np.argsort(a)]<br>
[(1,&nbsp;9),&nbsp;(1,&nbsp;0),&nbsp;(3,&nbsp;0),&nbsp;(4,&nbsp;4),&nbsp;(4,&nbsp;2),&nbsp;(4,&nbsp;1),&nbsp;(5,&nbsp;4)]<br>
&nbsp;<br>
Structured&nbsp;arrays&nbsp;are&nbsp;sorted&nbsp;lexically&nbsp;by&nbsp;``argsort``:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-array">array</a>([(1,9),&nbsp;(5,4),&nbsp;(1,0),&nbsp;(4,4),&nbsp;(3,0),&nbsp;(4,2),&nbsp;(4,1)],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=np.dtype([('x',&nbsp;int),&nbsp;('y',&nbsp;int)]))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.argsort(x)&nbsp;#&nbsp;or&nbsp;np.argsort(x,&nbsp;order=('x',&nbsp;'y'))<br>
<a href="#-array">array</a>([2,&nbsp;0,&nbsp;4,&nbsp;6,&nbsp;5,&nbsp;3,&nbsp;1])</tt></dd></dl>
 <dl><dt><a name="-loads"><strong>loads</strong></a>(...)</dt><dd><tt><a href="#-loads">loads</a>(string)&nbsp;--&nbsp;Load&nbsp;a&nbsp;pickle&nbsp;from&nbsp;the&nbsp;given&nbsp;string</tt></dd></dl>
 <dl><dt><a name="-logistic"><strong>logistic</strong></a>(...)</dt><dd><tt><a href="#-logistic">logistic</a>(loc=0.0,&nbsp;scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Logistic&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Logistic&nbsp;distribution&nbsp;with&nbsp;specified<br>
parameters,&nbsp;loc&nbsp;(location&nbsp;or&nbsp;mean,&nbsp;also&nbsp;median),&nbsp;and&nbsp;scale&nbsp;(&gt;0).<br>
&nbsp;<br>
Parameters<br>
----------<br>
loc&nbsp;:&nbsp;float<br>
&nbsp;<br>
scale&nbsp;:&nbsp;float&nbsp;&gt;&nbsp;0.<br>
&nbsp;<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;{ndarray,&nbsp;scalar}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;the&nbsp;values&nbsp;are&nbsp;all&nbsp;integers&nbsp;in&nbsp;&nbsp;[0,&nbsp;n].<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.logistic&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Logistic&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x)&nbsp;=&nbsp;P(x)&nbsp;=&nbsp;\frac{e^{-(x-\mu)/s}}{s(1+e^{-(x-\mu)/s})^2},<br>
&nbsp;<br>
where&nbsp;:math:`\mu`&nbsp;=&nbsp;location&nbsp;and&nbsp;:math:`s`&nbsp;=&nbsp;scale.<br>
&nbsp;<br>
The&nbsp;Logistic&nbsp;distribution&nbsp;is&nbsp;used&nbsp;in&nbsp;Extreme&nbsp;Value&nbsp;problems&nbsp;where&nbsp;it<br>
can&nbsp;act&nbsp;as&nbsp;a&nbsp;mixture&nbsp;of&nbsp;Gumbel&nbsp;distributions,&nbsp;in&nbsp;Epidemiology,&nbsp;and&nbsp;by<br>
the&nbsp;World&nbsp;Chess&nbsp;Federation&nbsp;(FIDE)&nbsp;where&nbsp;it&nbsp;is&nbsp;used&nbsp;in&nbsp;the&nbsp;Elo&nbsp;ranking<br>
system,&nbsp;assuming&nbsp;the&nbsp;performance&nbsp;of&nbsp;each&nbsp;player&nbsp;is&nbsp;a&nbsp;logistically<br>
distributed&nbsp;random&nbsp;variable.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Reiss,&nbsp;R.-D.&nbsp;and&nbsp;Thomas&nbsp;M.&nbsp;(2001),&nbsp;Statistical&nbsp;Analysis&nbsp;of&nbsp;Extreme<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Values,&nbsp;from&nbsp;Insurance,&nbsp;Finance,&nbsp;Hydrology&nbsp;and&nbsp;Other&nbsp;Fields,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Birkhauser&nbsp;Verlag,&nbsp;Basel,&nbsp;pp&nbsp;132-133.<br>
..&nbsp;[2]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Logistic&nbsp;Distribution."&nbsp;From<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MathWorld--A&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/LogisticDistribution.html">http://mathworld.wolfram.com/LogisticDistribution.html</a><br>
..&nbsp;[3]&nbsp;Wikipedia,&nbsp;"Logistic-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Logistic-distribution">http://en.wikipedia.org/wiki/Logistic-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;loc,&nbsp;scale&nbsp;=&nbsp;10,&nbsp;1<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-logistic">logistic</a>(loc,&nbsp;scale,&nbsp;10000)<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;bins=50)<br>
&nbsp;<br>
#&nbsp;&nbsp;&nbsp;plot&nbsp;against&nbsp;distribution<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;def&nbsp;logist(x,&nbsp;loc,&nbsp;scale):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;logist(bins,&nbsp;loc,&nbsp;scale)*count.max()/\<br>
...&nbsp;logist(bins,&nbsp;loc,&nbsp;scale).max())<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-lognormal"><strong>lognormal</strong></a>(...)</dt><dd><tt><a href="#-lognormal">lognormal</a>(mean=0.0,&nbsp;sigma=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Return&nbsp;samples&nbsp;drawn&nbsp;from&nbsp;a&nbsp;log-normal&nbsp;distribution.<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;log-normal&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;mean,<br>
standard&nbsp;deviation,&nbsp;and&nbsp;array&nbsp;shape.&nbsp;&nbsp;Note&nbsp;that&nbsp;the&nbsp;mean&nbsp;and&nbsp;standard<br>
deviation&nbsp;are&nbsp;not&nbsp;the&nbsp;values&nbsp;for&nbsp;the&nbsp;distribution&nbsp;itself,&nbsp;but&nbsp;of&nbsp;the<br>
underlying&nbsp;normal&nbsp;distribution&nbsp;it&nbsp;is&nbsp;derived&nbsp;from.<br>
&nbsp;<br>
Parameters<br>
----------<br>
mean&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Mean&nbsp;value&nbsp;of&nbsp;the&nbsp;underlying&nbsp;normal&nbsp;distribution<br>
sigma&nbsp;:&nbsp;float,&nbsp;&gt;&nbsp;0.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Standard&nbsp;deviation&nbsp;of&nbsp;the&nbsp;underlying&nbsp;normal&nbsp;distribution<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;desired&nbsp;samples.&nbsp;An&nbsp;array&nbsp;of&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;`size`&nbsp;if&nbsp;given,<br>
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;`size`&nbsp;is&nbsp;None&nbsp;a&nbsp;float&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.lognorm&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,&nbsp;distribution,<br>
&nbsp;&nbsp;&nbsp;&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
A&nbsp;variable&nbsp;`x`&nbsp;has&nbsp;a&nbsp;log-normal&nbsp;distribution&nbsp;if&nbsp;`log(x)`&nbsp;is&nbsp;normally<br>
distributed.&nbsp;&nbsp;The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;log-normal<br>
distribution&nbsp;is:<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{1}{\sigma&nbsp;x&nbsp;\sqrt{2\pi}}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e^{(-\frac{(ln(x)-\mu)^2}{2\sigma^2})}<br>
&nbsp;<br>
where&nbsp;:math:`\mu`&nbsp;is&nbsp;the&nbsp;mean&nbsp;and&nbsp;:math:`\sigma`&nbsp;is&nbsp;the&nbsp;standard<br>
deviation&nbsp;of&nbsp;the&nbsp;normally&nbsp;distributed&nbsp;logarithm&nbsp;of&nbsp;the&nbsp;variable.<br>
A&nbsp;log-normal&nbsp;distribution&nbsp;results&nbsp;if&nbsp;a&nbsp;random&nbsp;variable&nbsp;is&nbsp;the&nbsp;*product*<br>
of&nbsp;a&nbsp;large&nbsp;number&nbsp;of&nbsp;independent,&nbsp;identically-distributed&nbsp;variables&nbsp;in<br>
the&nbsp;same&nbsp;way&nbsp;that&nbsp;a&nbsp;normal&nbsp;distribution&nbsp;results&nbsp;if&nbsp;the&nbsp;variable&nbsp;is&nbsp;the<br>
*sum*&nbsp;of&nbsp;a&nbsp;large&nbsp;number&nbsp;of&nbsp;independent,&nbsp;identically-distributed<br>
variables.<br>
&nbsp;<br>
References<br>
----------<br>
Limpert,&nbsp;E.,&nbsp;Stahel,&nbsp;W.&nbsp;A.,&nbsp;and&nbsp;Abbt,&nbsp;M.,&nbsp;"Log-normal&nbsp;Distributions<br>
across&nbsp;the&nbsp;Sciences:&nbsp;Keys&nbsp;and&nbsp;Clues,"&nbsp;*BioScience*,&nbsp;Vol.&nbsp;51,&nbsp;No.&nbsp;5,<br>
May,&nbsp;2001.&nbsp;&nbsp;<a href="http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf">http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf</a><br>
&nbsp;<br>
Reiss,&nbsp;R.D.&nbsp;and&nbsp;Thomas,&nbsp;M.,&nbsp;*Statistical&nbsp;Analysis&nbsp;of&nbsp;Extreme&nbsp;Values*,<br>
Basel:&nbsp;Birkhauser&nbsp;Verlag,&nbsp;2001,&nbsp;pp.&nbsp;31-32.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;mu,&nbsp;sigma&nbsp;=&nbsp;3.,&nbsp;1.&nbsp;#&nbsp;mean&nbsp;and&nbsp;standard&nbsp;deviation<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-lognormal">lognormal</a>(mu,&nbsp;sigma,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;100,&nbsp;normed=True,&nbsp;align='mid')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.linspace(min(bins),&nbsp;max(bins),&nbsp;10000)<br>
&gt;&gt;&gt;&nbsp;pdf&nbsp;=&nbsp;(np.exp(-(np.log(x)&nbsp;-&nbsp;mu)**2&nbsp;/&nbsp;(2&nbsp;*&nbsp;sigma**2))<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;(x&nbsp;*&nbsp;sigma&nbsp;*&nbsp;np.sqrt(2&nbsp;*&nbsp;np.pi)))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;pdf,&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.axis('tight')<br>
&gt;&gt;&gt;&nbsp;plt.show()<br>
&nbsp;<br>
Demonstrate&nbsp;that&nbsp;taking&nbsp;the&nbsp;products&nbsp;of&nbsp;random&nbsp;samples&nbsp;from&nbsp;a&nbsp;uniform<br>
distribution&nbsp;can&nbsp;be&nbsp;fit&nbsp;well&nbsp;by&nbsp;a&nbsp;log-normal&nbsp;probability&nbsp;density&nbsp;function.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;#&nbsp;Generate&nbsp;a&nbsp;thousand&nbsp;samples:&nbsp;each&nbsp;is&nbsp;the&nbsp;product&nbsp;of&nbsp;100&nbsp;random<br>
&gt;&gt;&gt;&nbsp;#&nbsp;values,&nbsp;drawn&nbsp;from&nbsp;a&nbsp;normal&nbsp;distribution.<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;[]<br>
&gt;&gt;&gt;&nbsp;for&nbsp;i&nbsp;in&nbsp;range(1000):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;=&nbsp;10.&nbsp;+&nbsp;np.random.<a href="#-random">random</a>(100)<br>
...&nbsp;&nbsp;&nbsp;&nbsp;b.append(np.product(a))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-array">array</a>(b)&nbsp;/&nbsp;np.min(b)&nbsp;#&nbsp;scale&nbsp;values&nbsp;to&nbsp;be&nbsp;positive<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(b,&nbsp;100,&nbsp;normed=True,&nbsp;align='center')<br>
&gt;&gt;&gt;&nbsp;sigma&nbsp;=&nbsp;np.std(np.log(b))<br>
&gt;&gt;&gt;&nbsp;mu&nbsp;=&nbsp;np.mean(np.log(b))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.linspace(min(bins),&nbsp;max(bins),&nbsp;10000)<br>
&gt;&gt;&gt;&nbsp;pdf&nbsp;=&nbsp;(np.exp(-(np.log(x)&nbsp;-&nbsp;mu)**2&nbsp;/&nbsp;(2&nbsp;*&nbsp;sigma**2))<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&nbsp;(x&nbsp;*&nbsp;sigma&nbsp;*&nbsp;np.sqrt(2&nbsp;*&nbsp;np.pi)))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;pdf,&nbsp;color='r',&nbsp;linewidth=2)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-logseries"><strong>logseries</strong></a>(...)</dt><dd><tt><a href="#-logseries">logseries</a>(p,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Logarithmic&nbsp;Series&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Log&nbsp;Series&nbsp;distribution&nbsp;with&nbsp;specified<br>
parameter,&nbsp;p&nbsp;(probability,&nbsp;0&nbsp;&lt;&nbsp;p&nbsp;&lt;&nbsp;1).<br>
&nbsp;<br>
Parameters<br>
----------<br>
loc&nbsp;:&nbsp;float<br>
&nbsp;<br>
scale&nbsp;:&nbsp;float&nbsp;&gt;&nbsp;0.<br>
&nbsp;<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;{ndarray,&nbsp;scalar}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;the&nbsp;values&nbsp;are&nbsp;all&nbsp;integers&nbsp;in&nbsp;&nbsp;[0,&nbsp;n].<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.logser&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Log&nbsp;Series&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(k)&nbsp;=&nbsp;\frac{-p^k}{k&nbsp;\ln(1-p)},<br>
&nbsp;<br>
where&nbsp;p&nbsp;=&nbsp;probability.<br>
&nbsp;<br>
The&nbsp;Log&nbsp;Series&nbsp;distribution&nbsp;is&nbsp;frequently&nbsp;used&nbsp;to&nbsp;represent&nbsp;species<br>
richness&nbsp;and&nbsp;occurrence,&nbsp;first&nbsp;proposed&nbsp;by&nbsp;Fisher,&nbsp;Corbet,&nbsp;and<br>
Williams&nbsp;in&nbsp;1943&nbsp;[2].&nbsp;&nbsp;It&nbsp;may&nbsp;also&nbsp;be&nbsp;used&nbsp;to&nbsp;model&nbsp;the&nbsp;numbers&nbsp;of<br>
occupants&nbsp;seen&nbsp;in&nbsp;cars&nbsp;[3].<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Buzas,&nbsp;Martin&nbsp;A.;&nbsp;Culver,&nbsp;Stephen&nbsp;J.,&nbsp;&nbsp;Understanding&nbsp;regional<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;species&nbsp;diversity&nbsp;through&nbsp;the&nbsp;log&nbsp;series&nbsp;distribution&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;occurrences:&nbsp;BIODIVERSITY&nbsp;RESEARCH&nbsp;Diversity&nbsp;&amp;&nbsp;Distributions,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Volume&nbsp;5,&nbsp;Number&nbsp;5,&nbsp;September&nbsp;1999&nbsp;,&nbsp;pp.&nbsp;187-195(9).<br>
..&nbsp;[2]&nbsp;Fisher,&nbsp;R.A,,&nbsp;A.S.&nbsp;Corbet,&nbsp;and&nbsp;C.B.&nbsp;Williams.&nbsp;1943.&nbsp;The<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;relation&nbsp;between&nbsp;the&nbsp;number&nbsp;of&nbsp;species&nbsp;and&nbsp;the&nbsp;number&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;individuals&nbsp;in&nbsp;a&nbsp;random&nbsp;sample&nbsp;of&nbsp;an&nbsp;animal&nbsp;population.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Journal&nbsp;of&nbsp;Animal&nbsp;Ecology,&nbsp;12:42-58.<br>
..&nbsp;[3]&nbsp;D.&nbsp;J.&nbsp;Hand,&nbsp;F.&nbsp;Daly,&nbsp;D.&nbsp;Lunn,&nbsp;E.&nbsp;Ostrowski,&nbsp;A&nbsp;Handbook&nbsp;of&nbsp;Small<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Data&nbsp;Sets,&nbsp;CRC&nbsp;Press,&nbsp;1994.<br>
..&nbsp;[4]&nbsp;Wikipedia,&nbsp;"Logarithmic-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Logarithmic-distribution">http://en.wikipedia.org/wiki/Logarithmic-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;.6<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-logseries">logseries</a>(a,&nbsp;10000)<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s)<br>
&nbsp;<br>
#&nbsp;&nbsp;&nbsp;plot&nbsp;against&nbsp;distribution<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;def&nbsp;<a href="#-logseries">logseries</a>(k,&nbsp;p):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;-p**k/(k*log(1-p))<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;<a href="#-logseries">logseries</a>(bins,&nbsp;a)*count.max()/<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#-logseries">logseries</a>(bins,&nbsp;a).max(),&nbsp;'r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-may_share_memory"><strong>may_share_memory</strong></a>(...)</dt><dd><tt>Determine&nbsp;if&nbsp;two&nbsp;arrays&nbsp;can&nbsp;share&nbsp;memory<br>
&nbsp;<br>
The&nbsp;memory-bounds&nbsp;of&nbsp;a&nbsp;and&nbsp;b&nbsp;are&nbsp;computed.&nbsp;&nbsp;If&nbsp;they&nbsp;overlap&nbsp;then<br>
this&nbsp;function&nbsp;returns&nbsp;True.&nbsp;&nbsp;Otherwise,&nbsp;it&nbsp;returns&nbsp;False.<br>
&nbsp;<br>
A&nbsp;return&nbsp;of&nbsp;True&nbsp;does&nbsp;not&nbsp;necessarily&nbsp;mean&nbsp;that&nbsp;the&nbsp;two&nbsp;arrays<br>
share&nbsp;any&nbsp;element.&nbsp;&nbsp;It&nbsp;just&nbsp;means&nbsp;that&nbsp;they&nbsp;*might*.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a,&nbsp;b&nbsp;:&nbsp;ndarray<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;bool<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-may_share_memory">may_share_memory</a>(np.<a href="#-array">array</a>([1,2]),&nbsp;np.<a href="#-array">array</a>([5,8,9]))<br>
False</tt></dd></dl>
 <dl><dt><a name="-min_scalar_type"><strong>min_scalar_type</strong></a>(...)</dt><dd><tt><a href="#-min_scalar_type">min_scalar_type</a>(a)<br>
&nbsp;<br>
For&nbsp;scalar&nbsp;``a``,&nbsp;returns&nbsp;the&nbsp;data&nbsp;type&nbsp;with&nbsp;the&nbsp;smallest&nbsp;size<br>
and&nbsp;smallest&nbsp;scalar&nbsp;kind&nbsp;which&nbsp;can&nbsp;hold&nbsp;its&nbsp;value.&nbsp;&nbsp;For&nbsp;non-scalar<br>
array&nbsp;``a``,&nbsp;returns&nbsp;the&nbsp;vector's&nbsp;dtype&nbsp;unmodified.<br>
&nbsp;<br>
Floating&nbsp;point&nbsp;values&nbsp;are&nbsp;not&nbsp;demoted&nbsp;to&nbsp;integers,<br>
and&nbsp;complex&nbsp;values&nbsp;are&nbsp;not&nbsp;demoted&nbsp;to&nbsp;floats.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;value&nbsp;whose&nbsp;minimal&nbsp;data&nbsp;type&nbsp;is&nbsp;to&nbsp;be&nbsp;found.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;dtype<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;minimal&nbsp;data&nbsp;type.<br>
&nbsp;<br>
Notes<br>
-----<br>
..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
result_type,&nbsp;promote_types,&nbsp;dtype,&nbsp;can_cast<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-min_scalar_type">min_scalar_type</a>(10)<br>
dtype('uint8')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-min_scalar_type">min_scalar_type</a>(-260)<br>
dtype('int16')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-min_scalar_type">min_scalar_type</a>(3.1)<br>
dtype('float16')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-min_scalar_type">min_scalar_type</a>(1e50)<br>
dtype('float64')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-min_scalar_type">min_scalar_type</a>(np.<a href="#-arange">arange</a>(4,dtype='f8'))<br>
dtype('float64')</tt></dd></dl>
 <dl><dt><a name="-multinomial"><strong>multinomial</strong></a>(...)</dt><dd><tt><a href="#-multinomial">multinomial</a>(n,&nbsp;pvals,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;multinomial&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;multinomial&nbsp;distribution&nbsp;is&nbsp;a&nbsp;multivariate&nbsp;generalisation&nbsp;of&nbsp;the<br>
binomial&nbsp;distribution.&nbsp;&nbsp;Take&nbsp;an&nbsp;experiment&nbsp;with&nbsp;one&nbsp;of&nbsp;``p``<br>
possible&nbsp;outcomes.&nbsp;&nbsp;An&nbsp;example&nbsp;of&nbsp;such&nbsp;an&nbsp;experiment&nbsp;is&nbsp;throwing&nbsp;a&nbsp;dice,<br>
where&nbsp;the&nbsp;outcome&nbsp;can&nbsp;be&nbsp;1&nbsp;through&nbsp;6.&nbsp;&nbsp;Each&nbsp;sample&nbsp;drawn&nbsp;from&nbsp;the<br>
distribution&nbsp;represents&nbsp;`n`&nbsp;such&nbsp;experiments.&nbsp;&nbsp;Its&nbsp;values,<br>
``X_i&nbsp;=&nbsp;[X_0,&nbsp;X_1,&nbsp;...,&nbsp;X_p]``,&nbsp;represent&nbsp;the&nbsp;number&nbsp;of&nbsp;times&nbsp;the&nbsp;outcome<br>
was&nbsp;``i``.<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;of&nbsp;experiments.<br>
pvals&nbsp;:&nbsp;sequence&nbsp;of&nbsp;floats,&nbsp;length&nbsp;p<br>
&nbsp;&nbsp;&nbsp;&nbsp;Probabilities&nbsp;of&nbsp;each&nbsp;of&nbsp;the&nbsp;``p``&nbsp;different&nbsp;outcomes.&nbsp;&nbsp;These<br>
&nbsp;&nbsp;&nbsp;&nbsp;should&nbsp;sum&nbsp;to&nbsp;1&nbsp;(however,&nbsp;the&nbsp;last&nbsp;element&nbsp;is&nbsp;always&nbsp;assumed&nbsp;to<br>
&nbsp;&nbsp;&nbsp;&nbsp;account&nbsp;for&nbsp;the&nbsp;remaining&nbsp;probability,&nbsp;as&nbsp;long&nbsp;as<br>
&nbsp;&nbsp;&nbsp;&nbsp;``sum(pvals[:-1])&nbsp;&lt;=&nbsp;1)``.<br>
size&nbsp;:&nbsp;tuple&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Given&nbsp;a&nbsp;`size`&nbsp;of&nbsp;``(M,&nbsp;N,&nbsp;K)``,&nbsp;then&nbsp;``M*N*K``&nbsp;samples&nbsp;are&nbsp;drawn,<br>
&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;the&nbsp;output&nbsp;shape&nbsp;becomes&nbsp;``(M,&nbsp;N,&nbsp;K,&nbsp;p)``,&nbsp;since&nbsp;each&nbsp;sample<br>
&nbsp;&nbsp;&nbsp;&nbsp;has&nbsp;shape&nbsp;``(p,)``.<br>
&nbsp;<br>
Examples<br>
--------<br>
Throw&nbsp;a&nbsp;dice&nbsp;20&nbsp;times:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-multinomial">multinomial</a>(20,&nbsp;[1/6.]*6,&nbsp;size=1)<br>
<a href="#-array">array</a>([[4,&nbsp;1,&nbsp;7,&nbsp;5,&nbsp;2,&nbsp;1]])<br>
&nbsp;<br>
It&nbsp;landed&nbsp;4&nbsp;times&nbsp;on&nbsp;1,&nbsp;once&nbsp;on&nbsp;2,&nbsp;etc.<br>
&nbsp;<br>
Now,&nbsp;throw&nbsp;the&nbsp;dice&nbsp;20&nbsp;times,&nbsp;and&nbsp;20&nbsp;times&nbsp;again:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-multinomial">multinomial</a>(20,&nbsp;[1/6.]*6,&nbsp;size=2)<br>
<a href="#-array">array</a>([[3,&nbsp;4,&nbsp;3,&nbsp;3,&nbsp;4,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[2,&nbsp;4,&nbsp;3,&nbsp;4,&nbsp;0,&nbsp;7]])<br>
&nbsp;<br>
For&nbsp;the&nbsp;first&nbsp;run,&nbsp;we&nbsp;threw&nbsp;3&nbsp;times&nbsp;1,&nbsp;4&nbsp;times&nbsp;2,&nbsp;etc.&nbsp;&nbsp;For&nbsp;the&nbsp;second,<br>
we&nbsp;threw&nbsp;2&nbsp;times&nbsp;1,&nbsp;4&nbsp;times&nbsp;2,&nbsp;etc.<br>
&nbsp;<br>
A&nbsp;loaded&nbsp;dice&nbsp;is&nbsp;more&nbsp;likely&nbsp;to&nbsp;land&nbsp;on&nbsp;number&nbsp;6:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-multinomial">multinomial</a>(100,&nbsp;[1/7.]*5)<br>
<a href="#-array">array</a>([13,&nbsp;16,&nbsp;13,&nbsp;16,&nbsp;42])</tt></dd></dl>
 <dl><dt><a name="-multivariate_normal"><strong>multivariate_normal</strong></a>(...)</dt><dd><tt><a href="#-multivariate_normal">multivariate_normal</a>(mean,&nbsp;cov[,&nbsp;size])<br>
&nbsp;<br>
Draw&nbsp;random&nbsp;samples&nbsp;from&nbsp;a&nbsp;multivariate&nbsp;normal&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;multivariate&nbsp;normal,&nbsp;multinormal&nbsp;or&nbsp;Gaussian&nbsp;distribution&nbsp;is&nbsp;a<br>
generalization&nbsp;of&nbsp;the&nbsp;one-dimensional&nbsp;normal&nbsp;distribution&nbsp;to&nbsp;higher<br>
dimensions.&nbsp;&nbsp;Such&nbsp;a&nbsp;distribution&nbsp;is&nbsp;specified&nbsp;by&nbsp;its&nbsp;mean&nbsp;and<br>
covariance&nbsp;matrix.&nbsp;&nbsp;These&nbsp;parameters&nbsp;are&nbsp;analogous&nbsp;to&nbsp;the&nbsp;mean<br>
(average&nbsp;or&nbsp;"center")&nbsp;and&nbsp;variance&nbsp;(standard&nbsp;deviation,&nbsp;or&nbsp;"width,"<br>
squared)&nbsp;of&nbsp;the&nbsp;one-dimensional&nbsp;normal&nbsp;distribution.<br>
&nbsp;<br>
Parameters<br>
----------<br>
mean&nbsp;:&nbsp;1-D&nbsp;array_like,&nbsp;of&nbsp;length&nbsp;N<br>
&nbsp;&nbsp;&nbsp;&nbsp;Mean&nbsp;of&nbsp;the&nbsp;N-dimensional&nbsp;distribution.<br>
cov&nbsp;:&nbsp;2-D&nbsp;array_like,&nbsp;of&nbsp;shape&nbsp;(N,&nbsp;N)<br>
&nbsp;&nbsp;&nbsp;&nbsp;Covariance&nbsp;matrix&nbsp;of&nbsp;the&nbsp;distribution.&nbsp;&nbsp;Must&nbsp;be&nbsp;symmetric&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;positive-semidefinite&nbsp;for&nbsp;"physically&nbsp;meaningful"&nbsp;results.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Given&nbsp;a&nbsp;shape&nbsp;of,&nbsp;for&nbsp;example,&nbsp;``(m,n,k)``,&nbsp;``m*n*k``&nbsp;samples&nbsp;are<br>
&nbsp;&nbsp;&nbsp;&nbsp;generated,&nbsp;and&nbsp;packed&nbsp;in&nbsp;an&nbsp;`m`-by-`n`-by-`k`&nbsp;arrangement.&nbsp;&nbsp;Because<br>
&nbsp;&nbsp;&nbsp;&nbsp;each&nbsp;sample&nbsp;is&nbsp;`N`-dimensional,&nbsp;the&nbsp;output&nbsp;shape&nbsp;is&nbsp;``(m,n,k,N)``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;no&nbsp;shape&nbsp;is&nbsp;specified,&nbsp;a&nbsp;single&nbsp;(`N`-D)&nbsp;sample&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;drawn&nbsp;samples,&nbsp;of&nbsp;shape&nbsp;*size*,&nbsp;if&nbsp;that&nbsp;was&nbsp;provided.&nbsp;&nbsp;If&nbsp;not,<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;shape&nbsp;is&nbsp;``(N,)``.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;other&nbsp;words,&nbsp;each&nbsp;entry&nbsp;``out[i,j,...,:]``&nbsp;is&nbsp;an&nbsp;N-dimensional<br>
&nbsp;&nbsp;&nbsp;&nbsp;value&nbsp;drawn&nbsp;from&nbsp;the&nbsp;distribution.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;mean&nbsp;is&nbsp;a&nbsp;coordinate&nbsp;in&nbsp;N-dimensional&nbsp;space,&nbsp;which&nbsp;represents&nbsp;the<br>
location&nbsp;where&nbsp;samples&nbsp;are&nbsp;most&nbsp;likely&nbsp;to&nbsp;be&nbsp;generated.&nbsp;&nbsp;This&nbsp;is<br>
analogous&nbsp;to&nbsp;the&nbsp;peak&nbsp;of&nbsp;the&nbsp;bell&nbsp;curve&nbsp;for&nbsp;the&nbsp;one-dimensional&nbsp;or<br>
univariate&nbsp;normal&nbsp;distribution.<br>
&nbsp;<br>
Covariance&nbsp;indicates&nbsp;the&nbsp;level&nbsp;to&nbsp;which&nbsp;two&nbsp;variables&nbsp;vary&nbsp;together.<br>
From&nbsp;the&nbsp;multivariate&nbsp;normal&nbsp;distribution,&nbsp;we&nbsp;draw&nbsp;N-dimensional<br>
samples,&nbsp;:math:`X&nbsp;=&nbsp;[x_1,&nbsp;x_2,&nbsp;...&nbsp;x_N]`.&nbsp;&nbsp;The&nbsp;covariance&nbsp;matrix<br>
element&nbsp;:math:`C_{ij}`&nbsp;is&nbsp;the&nbsp;covariance&nbsp;of&nbsp;:math:`x_i`&nbsp;and&nbsp;:math:`x_j`.<br>
The&nbsp;element&nbsp;:math:`C_{ii}`&nbsp;is&nbsp;the&nbsp;variance&nbsp;of&nbsp;:math:`x_i`&nbsp;(i.e.&nbsp;its<br>
"spread").<br>
&nbsp;<br>
Instead&nbsp;of&nbsp;specifying&nbsp;the&nbsp;full&nbsp;covariance&nbsp;matrix,&nbsp;popular<br>
approximations&nbsp;include:<br>
&nbsp;<br>
&nbsp;&nbsp;-&nbsp;Spherical&nbsp;covariance&nbsp;(*cov*&nbsp;is&nbsp;a&nbsp;multiple&nbsp;of&nbsp;the&nbsp;identity&nbsp;matrix)<br>
&nbsp;&nbsp;-&nbsp;Diagonal&nbsp;covariance&nbsp;(*cov*&nbsp;has&nbsp;non-negative&nbsp;elements,&nbsp;and&nbsp;only&nbsp;on<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;diagonal)<br>
&nbsp;<br>
This&nbsp;geometrical&nbsp;property&nbsp;can&nbsp;be&nbsp;seen&nbsp;in&nbsp;two&nbsp;dimensions&nbsp;by&nbsp;plotting<br>
generated&nbsp;data-points:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;mean&nbsp;=&nbsp;[0,0]<br>
&gt;&gt;&gt;&nbsp;cov&nbsp;=&nbsp;[[1,0],[0,100]]&nbsp;#&nbsp;diagonal&nbsp;covariance,&nbsp;points&nbsp;lie&nbsp;on&nbsp;x&nbsp;or&nbsp;y-axis<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;x,y&nbsp;=&nbsp;np.random.<a href="#-multivariate_normal">multivariate_normal</a>(mean,cov,5000).T<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,y,'x');&nbsp;plt.axis('equal');&nbsp;plt.show()<br>
&nbsp;<br>
Note&nbsp;that&nbsp;the&nbsp;covariance&nbsp;matrix&nbsp;must&nbsp;be&nbsp;non-negative&nbsp;definite.<br>
&nbsp;<br>
References<br>
----------<br>
Papoulis,&nbsp;A.,&nbsp;*Probability,&nbsp;Random&nbsp;Variables,&nbsp;and&nbsp;Stochastic&nbsp;Processes*,<br>
3rd&nbsp;ed.,&nbsp;New&nbsp;York:&nbsp;McGraw-Hill,&nbsp;1991.<br>
&nbsp;<br>
Duda,&nbsp;R.&nbsp;O.,&nbsp;Hart,&nbsp;P.&nbsp;E.,&nbsp;and&nbsp;Stork,&nbsp;D.&nbsp;G.,&nbsp;*Pattern&nbsp;Classification*,<br>
2nd&nbsp;ed.,&nbsp;New&nbsp;York:&nbsp;Wiley,&nbsp;2001.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;mean&nbsp;=&nbsp;(1,2)<br>
&gt;&gt;&gt;&nbsp;cov&nbsp;=&nbsp;[[1,0],[1,0]]<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.random.<a href="#-multivariate_normal">multivariate_normal</a>(mean,cov,(3,3))<br>
&gt;&gt;&gt;&nbsp;x.shape<br>
(3,&nbsp;3,&nbsp;2)<br>
&nbsp;<br>
The&nbsp;following&nbsp;is&nbsp;probably&nbsp;true,&nbsp;given&nbsp;that&nbsp;0.6&nbsp;is&nbsp;roughly&nbsp;twice&nbsp;the<br>
standard&nbsp;deviation:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;print&nbsp;list(&nbsp;(x[0,0,:]&nbsp;-&nbsp;mean)&nbsp;&lt;&nbsp;0.6&nbsp;)<br>
[True,&nbsp;True]</tt></dd></dl>
 <dl><dt><a name="-negative_binomial"><strong>negative_binomial</strong></a>(...)</dt><dd><tt><a href="#-negative_binomial">negative_binomial</a>(n,&nbsp;p,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;negative_binomial&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;negative_Binomial&nbsp;distribution&nbsp;with&nbsp;specified<br>
parameters,&nbsp;`n`&nbsp;trials&nbsp;and&nbsp;`p`&nbsp;probability&nbsp;of&nbsp;success&nbsp;where&nbsp;`n`&nbsp;is&nbsp;an<br>
integer&nbsp;&gt;&nbsp;0&nbsp;and&nbsp;`p`&nbsp;is&nbsp;in&nbsp;the&nbsp;interval&nbsp;[0,&nbsp;1].<br>
&nbsp;<br>
Parameters<br>
----------<br>
n&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Parameter,&nbsp;&gt;&nbsp;0.<br>
p&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Parameter,&nbsp;&gt;=&nbsp;0&nbsp;and&nbsp;&lt;=1.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;int&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;samples.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Negative&nbsp;Binomial&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(N;n,p)&nbsp;=&nbsp;\binom{N+n-1}{n-1}p^{n}(1-p)^{N},<br>
&nbsp;<br>
where&nbsp;:math:`n-1`&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;successes,&nbsp;:math:`p`&nbsp;is&nbsp;the&nbsp;probability<br>
of&nbsp;success,&nbsp;and&nbsp;:math:`N+n-1`&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;trials.<br>
&nbsp;<br>
The&nbsp;negative&nbsp;binomial&nbsp;distribution&nbsp;gives&nbsp;the&nbsp;probability&nbsp;of&nbsp;n-1&nbsp;successes<br>
and&nbsp;N&nbsp;failures&nbsp;in&nbsp;N+n-1&nbsp;trials,&nbsp;and&nbsp;success&nbsp;on&nbsp;the&nbsp;(N+n)th&nbsp;trial.<br>
&nbsp;<br>
If&nbsp;one&nbsp;throws&nbsp;a&nbsp;die&nbsp;repeatedly&nbsp;until&nbsp;the&nbsp;third&nbsp;time&nbsp;a&nbsp;"1"&nbsp;appears,&nbsp;then&nbsp;the<br>
probability&nbsp;distribution&nbsp;of&nbsp;the&nbsp;number&nbsp;of&nbsp;non-"1"s&nbsp;that&nbsp;appear&nbsp;before&nbsp;the<br>
third&nbsp;"1"&nbsp;is&nbsp;a&nbsp;negative&nbsp;binomial&nbsp;distribution.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Negative&nbsp;Binomial&nbsp;Distribution."&nbsp;From<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MathWorld--A&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/NegativeBinomialDistribution.html">http://mathworld.wolfram.com/NegativeBinomialDistribution.html</a><br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Negative&nbsp;binomial&nbsp;distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Negative_binomial_distribution">http://en.wikipedia.org/wiki/Negative_binomial_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
A&nbsp;real&nbsp;world&nbsp;example.&nbsp;A&nbsp;company&nbsp;drills&nbsp;wild-cat&nbsp;oil&nbsp;exploration&nbsp;wells,&nbsp;each<br>
with&nbsp;an&nbsp;estimated&nbsp;probability&nbsp;of&nbsp;success&nbsp;of&nbsp;0.1.&nbsp;&nbsp;What&nbsp;is&nbsp;the&nbsp;probability<br>
of&nbsp;having&nbsp;one&nbsp;success&nbsp;for&nbsp;each&nbsp;successive&nbsp;well,&nbsp;that&nbsp;is&nbsp;what&nbsp;is&nbsp;the<br>
probability&nbsp;of&nbsp;a&nbsp;single&nbsp;success&nbsp;after&nbsp;drilling&nbsp;5&nbsp;wells,&nbsp;after&nbsp;6&nbsp;wells,<br>
etc.?<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-negative_binomial">negative_binomial</a>(1,&nbsp;0.1,&nbsp;100000)<br>
&gt;&gt;&gt;&nbsp;for&nbsp;i&nbsp;in&nbsp;range(1,&nbsp;11):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;probability&nbsp;=&nbsp;sum(s&lt;i)&nbsp;/&nbsp;100000.<br>
...&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;i,&nbsp;"wells&nbsp;drilled,&nbsp;probability&nbsp;of&nbsp;one&nbsp;success&nbsp;=",&nbsp;probability</tt></dd></dl>
 <dl><dt><a name="-nested_iters"><strong>nested_iters</strong></a>(...)</dt></dl>
 <dl><dt><a name="-newbuffer"><strong>newbuffer</strong></a>(...)</dt><dd><tt><a href="#-newbuffer">newbuffer</a>(size)<br>
&nbsp;<br>
Return&nbsp;a&nbsp;new&nbsp;uninitialized&nbsp;buffer&nbsp;object.<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Size&nbsp;in&nbsp;bytes&nbsp;of&nbsp;returned&nbsp;buffer&nbsp;object.<br>
&nbsp;<br>
Returns<br>
-------<br>
newbuffer&nbsp;:&nbsp;buffer&nbsp;object<br>
&nbsp;&nbsp;&nbsp;&nbsp;Returned,&nbsp;uninitialized&nbsp;buffer&nbsp;object&nbsp;of&nbsp;`size`&nbsp;bytes.</tt></dd></dl>
 <dl><dt><a name="-noncentral_chisquare"><strong>noncentral_chisquare</strong></a>(...)</dt><dd><tt><a href="#-noncentral_chisquare">noncentral_chisquare</a>(df,&nbsp;nonc,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;noncentral&nbsp;chi-square&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;noncentral&nbsp;:math:`\chi^2`&nbsp;distribution&nbsp;is&nbsp;a&nbsp;generalisation&nbsp;of<br>
the&nbsp;:math:`\chi^2`&nbsp;distribution.<br>
&nbsp;<br>
Parameters<br>
----------<br>
df&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Degrees&nbsp;of&nbsp;freedom,&nbsp;should&nbsp;be&nbsp;&gt;=&nbsp;1.<br>
nonc&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Non-centrality,&nbsp;should&nbsp;be&nbsp;&gt;&nbsp;0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;noncentral&nbsp;Chi-square&nbsp;distribution<br>
is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x;df,nonc)&nbsp;=&nbsp;\sum^{\infty}_{i=0}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\frac{e^{-nonc/2}(nonc/2)^{i}}{i!}P_{Y_{df+2i}}(x),<br>
&nbsp;<br>
where&nbsp;:math:`Y_{q}`&nbsp;is&nbsp;the&nbsp;Chi-square&nbsp;with&nbsp;q&nbsp;degrees&nbsp;of&nbsp;freedom.<br>
&nbsp;<br>
In&nbsp;Delhi&nbsp;(2007),&nbsp;it&nbsp;is&nbsp;noted&nbsp;that&nbsp;the&nbsp;noncentral&nbsp;chi-square&nbsp;is&nbsp;useful&nbsp;in<br>
bombing&nbsp;and&nbsp;coverage&nbsp;problems,&nbsp;the&nbsp;probability&nbsp;of&nbsp;killing&nbsp;the&nbsp;point&nbsp;target<br>
given&nbsp;by&nbsp;the&nbsp;noncentral&nbsp;chi-squared&nbsp;distribution.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Delhi,&nbsp;M.S.&nbsp;Holla,&nbsp;"On&nbsp;a&nbsp;noncentral&nbsp;chi-square&nbsp;distribution&nbsp;in&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;analysis&nbsp;of&nbsp;weapon&nbsp;systems&nbsp;effectiveness",&nbsp;Metrika,&nbsp;Volume&nbsp;15,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Number&nbsp;1&nbsp;/&nbsp;December,&nbsp;1970.<br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Noncentral&nbsp;chi-square&nbsp;distribution"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution">http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;values&nbsp;from&nbsp;the&nbsp;distribution&nbsp;and&nbsp;plot&nbsp;the&nbsp;histogram<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;values&nbsp;=&nbsp;plt.hist(np.random.<a href="#-noncentral_chisquare">noncentral_chisquare</a>(3,&nbsp;20,&nbsp;100000),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bins=200,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.show()<br>
&nbsp;<br>
Draw&nbsp;values&nbsp;from&nbsp;a&nbsp;noncentral&nbsp;chisquare&nbsp;with&nbsp;very&nbsp;small&nbsp;noncentrality,<br>
and&nbsp;compare&nbsp;to&nbsp;a&nbsp;chisquare.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.figure()<br>
&gt;&gt;&gt;&nbsp;values&nbsp;=&nbsp;plt.hist(np.random.<a href="#-noncentral_chisquare">noncentral_chisquare</a>(3,&nbsp;.0000001,&nbsp;100000),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bins=np.<a href="#-arange">arange</a>(0.,&nbsp;25,&nbsp;.1),&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;values2&nbsp;=&nbsp;plt.hist(np.random.<a href="#-chisquare">chisquare</a>(3,&nbsp;100000),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bins=np.<a href="#-arange">arange</a>(0.,&nbsp;25,&nbsp;.1),&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(values[1][0:-1],&nbsp;values[0]-values2[0],&nbsp;'ob')<br>
&gt;&gt;&gt;&nbsp;plt.show()<br>
&nbsp;<br>
Demonstrate&nbsp;how&nbsp;large&nbsp;values&nbsp;of&nbsp;non-centrality&nbsp;lead&nbsp;to&nbsp;a&nbsp;more&nbsp;symmetric<br>
distribution.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.figure()<br>
&gt;&gt;&gt;&nbsp;values&nbsp;=&nbsp;plt.hist(np.random.<a href="#-noncentral_chisquare">noncentral_chisquare</a>(3,&nbsp;20,&nbsp;100000),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bins=200,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-noncentral_f"><strong>noncentral_f</strong></a>(...)</dt><dd><tt><a href="#-noncentral_f">noncentral_f</a>(dfnum,&nbsp;dfden,&nbsp;nonc,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;noncentral&nbsp;F&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;an&nbsp;F&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;parameters,<br>
`dfnum`&nbsp;(degrees&nbsp;of&nbsp;freedom&nbsp;in&nbsp;numerator)&nbsp;and&nbsp;`dfden`&nbsp;(degrees&nbsp;of<br>
freedom&nbsp;in&nbsp;denominator),&nbsp;where&nbsp;both&nbsp;parameters&nbsp;&gt;&nbsp;1.<br>
`nonc`&nbsp;is&nbsp;the&nbsp;non-centrality&nbsp;parameter.<br>
&nbsp;<br>
Parameters<br>
----------<br>
dfnum&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Parameter,&nbsp;should&nbsp;be&nbsp;&gt;&nbsp;1.<br>
dfden&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Parameter,&nbsp;should&nbsp;be&nbsp;&gt;&nbsp;1.<br>
nonc&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Parameter,&nbsp;should&nbsp;be&nbsp;&gt;=&nbsp;0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;scalar&nbsp;or&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;samples.<br>
&nbsp;<br>
Notes<br>
-----<br>
When&nbsp;calculating&nbsp;the&nbsp;power&nbsp;of&nbsp;an&nbsp;experiment&nbsp;(power&nbsp;=&nbsp;probability&nbsp;of<br>
rejecting&nbsp;the&nbsp;null&nbsp;hypothesis&nbsp;when&nbsp;a&nbsp;specific&nbsp;alternative&nbsp;is&nbsp;true)&nbsp;the<br>
non-central&nbsp;F&nbsp;statistic&nbsp;becomes&nbsp;important.&nbsp;&nbsp;When&nbsp;the&nbsp;null&nbsp;hypothesis&nbsp;is<br>
true,&nbsp;the&nbsp;F&nbsp;statistic&nbsp;follows&nbsp;a&nbsp;central&nbsp;F&nbsp;distribution.&nbsp;When&nbsp;the&nbsp;null<br>
hypothesis&nbsp;is&nbsp;not&nbsp;true,&nbsp;then&nbsp;it&nbsp;follows&nbsp;a&nbsp;non-central&nbsp;F&nbsp;statistic.<br>
&nbsp;<br>
References<br>
----------<br>
Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Noncentral&nbsp;F-Distribution."&nbsp;From&nbsp;MathWorld--A&nbsp;Wolfram<br>
Web&nbsp;Resource.&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/NoncentralF-Distribution.html">http://mathworld.wolfram.com/NoncentralF-Distribution.html</a><br>
&nbsp;<br>
Wikipedia,&nbsp;"Noncentral&nbsp;F&nbsp;distribution",<br>
<a href="http://en.wikipedia.org/wiki/Noncentral_F-distribution">http://en.wikipedia.org/wiki/Noncentral_F-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
In&nbsp;a&nbsp;study,&nbsp;testing&nbsp;for&nbsp;a&nbsp;specific&nbsp;alternative&nbsp;to&nbsp;the&nbsp;null&nbsp;hypothesis<br>
requires&nbsp;use&nbsp;of&nbsp;the&nbsp;Noncentral&nbsp;F&nbsp;distribution.&nbsp;We&nbsp;need&nbsp;to&nbsp;calculate&nbsp;the<br>
area&nbsp;in&nbsp;the&nbsp;tail&nbsp;of&nbsp;the&nbsp;distribution&nbsp;that&nbsp;exceeds&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;F<br>
distribution&nbsp;for&nbsp;the&nbsp;null&nbsp;hypothesis.&nbsp;&nbsp;We'll&nbsp;plot&nbsp;the&nbsp;two&nbsp;probability<br>
distributions&nbsp;for&nbsp;comparison.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;dfnum&nbsp;=&nbsp;3&nbsp;#&nbsp;between&nbsp;group&nbsp;deg&nbsp;of&nbsp;freedom<br>
&gt;&gt;&gt;&nbsp;dfden&nbsp;=&nbsp;20&nbsp;#&nbsp;within&nbsp;groups&nbsp;degrees&nbsp;of&nbsp;freedom<br>
&gt;&gt;&gt;&nbsp;nonc&nbsp;=&nbsp;3.0<br>
&gt;&gt;&gt;&nbsp;nc_vals&nbsp;=&nbsp;np.random.<a href="#-noncentral_f">noncentral_f</a>(dfnum,&nbsp;dfden,&nbsp;nonc,&nbsp;1000000)<br>
&gt;&gt;&gt;&nbsp;NF&nbsp;=&nbsp;np.histogram(nc_vals,&nbsp;bins=50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;c_vals&nbsp;=&nbsp;np.random.<a href="#-f">f</a>(dfnum,&nbsp;dfden,&nbsp;1000000)<br>
&gt;&gt;&gt;&nbsp;F&nbsp;=&nbsp;np.histogram(c_vals,&nbsp;bins=50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(F[1][1:],&nbsp;F[0])<br>
&gt;&gt;&gt;&nbsp;plt.plot(NF[1][1:],&nbsp;NF[0])<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-normal"><strong>normal</strong></a>(...)</dt><dd><tt><a href="#-normal">normal</a>(loc=0.0,&nbsp;scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;random&nbsp;samples&nbsp;from&nbsp;a&nbsp;normal&nbsp;(Gaussian)&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;of&nbsp;the&nbsp;normal&nbsp;distribution,&nbsp;first<br>
derived&nbsp;by&nbsp;De&nbsp;Moivre&nbsp;and&nbsp;200&nbsp;years&nbsp;later&nbsp;by&nbsp;both&nbsp;Gauss&nbsp;and&nbsp;Laplace<br>
independently&nbsp;[2]_,&nbsp;is&nbsp;often&nbsp;called&nbsp;the&nbsp;bell&nbsp;curve&nbsp;because&nbsp;of<br>
its&nbsp;characteristic&nbsp;shape&nbsp;(see&nbsp;the&nbsp;example&nbsp;below).<br>
&nbsp;<br>
The&nbsp;normal&nbsp;distributions&nbsp;occurs&nbsp;often&nbsp;in&nbsp;nature.&nbsp;&nbsp;For&nbsp;example,&nbsp;it<br>
describes&nbsp;the&nbsp;commonly&nbsp;occurring&nbsp;distribution&nbsp;of&nbsp;samples&nbsp;influenced<br>
by&nbsp;a&nbsp;large&nbsp;number&nbsp;of&nbsp;tiny,&nbsp;random&nbsp;disturbances,&nbsp;each&nbsp;with&nbsp;its&nbsp;own<br>
unique&nbsp;distribution&nbsp;[2]_.<br>
&nbsp;<br>
Parameters<br>
----------<br>
loc&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Mean&nbsp;("centre")&nbsp;of&nbsp;the&nbsp;distribution.<br>
scale&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Standard&nbsp;deviation&nbsp;(spread&nbsp;or&nbsp;"width")&nbsp;of&nbsp;the&nbsp;distribution.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.norm&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Gaussian&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{1}{\sqrt{&nbsp;2&nbsp;\pi&nbsp;\sigma^2&nbsp;}}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e^{&nbsp;-&nbsp;\frac{&nbsp;(x&nbsp;-&nbsp;\mu)^2&nbsp;}&nbsp;{2&nbsp;\sigma^2}&nbsp;},<br>
&nbsp;<br>
where&nbsp;:math:`\mu`&nbsp;is&nbsp;the&nbsp;mean&nbsp;and&nbsp;:math:`\sigma`&nbsp;the&nbsp;standard&nbsp;deviation.<br>
The&nbsp;square&nbsp;of&nbsp;the&nbsp;standard&nbsp;deviation,&nbsp;:math:`\sigma^2`,&nbsp;is&nbsp;called&nbsp;the<br>
variance.<br>
&nbsp;<br>
The&nbsp;function&nbsp;has&nbsp;its&nbsp;peak&nbsp;at&nbsp;the&nbsp;mean,&nbsp;and&nbsp;its&nbsp;"spread"&nbsp;increases&nbsp;with<br>
the&nbsp;standard&nbsp;deviation&nbsp;(the&nbsp;function&nbsp;reaches&nbsp;0.607&nbsp;times&nbsp;its&nbsp;maximum&nbsp;at<br>
:math:`x&nbsp;+&nbsp;\sigma`&nbsp;and&nbsp;:math:`x&nbsp;-&nbsp;\sigma`&nbsp;[2]_).&nbsp;&nbsp;This&nbsp;implies&nbsp;that<br>
`numpy.random.normal`&nbsp;is&nbsp;more&nbsp;likely&nbsp;to&nbsp;return&nbsp;samples&nbsp;lying&nbsp;close&nbsp;to&nbsp;the<br>
mean,&nbsp;rather&nbsp;than&nbsp;those&nbsp;far&nbsp;away.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Wikipedia,&nbsp;"Normal&nbsp;distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Normal_distribution">http://en.wikipedia.org/wiki/Normal_distribution</a><br>
..&nbsp;[2]&nbsp;P.&nbsp;R.&nbsp;Peebles&nbsp;Jr.,&nbsp;"Central&nbsp;Limit&nbsp;Theorem"&nbsp;in&nbsp;"Probability,&nbsp;Random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Variables&nbsp;and&nbsp;Random&nbsp;Signal&nbsp;Principles",&nbsp;4th&nbsp;ed.,&nbsp;2001,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pp.&nbsp;51,&nbsp;51,&nbsp;125.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;mu,&nbsp;sigma&nbsp;=&nbsp;0,&nbsp;0.1&nbsp;#&nbsp;mean&nbsp;and&nbsp;standard&nbsp;deviation<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-normal">normal</a>(mu,&nbsp;sigma,&nbsp;1000)<br>
&nbsp;<br>
Verify&nbsp;the&nbsp;mean&nbsp;and&nbsp;the&nbsp;variance:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;abs(mu&nbsp;-&nbsp;np.mean(s))&nbsp;&lt;&nbsp;0.01<br>
True<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;abs(sigma&nbsp;-&nbsp;np.std(s,&nbsp;ddof=1))&nbsp;&lt;&nbsp;0.01<br>
True<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;30,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;1/(sigma&nbsp;*&nbsp;np.sqrt(2&nbsp;*&nbsp;np.pi))&nbsp;*<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;np.exp(&nbsp;-&nbsp;(bins&nbsp;-&nbsp;mu)**2&nbsp;/&nbsp;(2&nbsp;*&nbsp;sigma**2)&nbsp;),<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-packbits"><strong>packbits</strong></a>(...)</dt><dd><tt><a href="#-packbits">packbits</a>(myarray,&nbsp;axis=None)<br>
&nbsp;<br>
Packs&nbsp;the&nbsp;elements&nbsp;of&nbsp;a&nbsp;binary-valued&nbsp;array&nbsp;into&nbsp;bits&nbsp;in&nbsp;a&nbsp;uint8&nbsp;array.<br>
&nbsp;<br>
The&nbsp;result&nbsp;is&nbsp;padded&nbsp;to&nbsp;full&nbsp;bytes&nbsp;by&nbsp;inserting&nbsp;zero&nbsp;bits&nbsp;at&nbsp;the&nbsp;end.<br>
&nbsp;<br>
Parameters<br>
----------<br>
myarray&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;integer&nbsp;type&nbsp;array&nbsp;whose&nbsp;elements&nbsp;should&nbsp;be&nbsp;packed&nbsp;to&nbsp;bits.<br>
axis&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;dimension&nbsp;over&nbsp;which&nbsp;bit-packing&nbsp;is&nbsp;done.<br>
&nbsp;&nbsp;&nbsp;&nbsp;``None``&nbsp;implies&nbsp;packing&nbsp;the&nbsp;flattened&nbsp;array.<br>
&nbsp;<br>
Returns<br>
-------<br>
packed&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;type&nbsp;uint8&nbsp;whose&nbsp;elements&nbsp;represent&nbsp;bits&nbsp;corresponding&nbsp;to&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;logical&nbsp;(0&nbsp;or&nbsp;nonzero)&nbsp;value&nbsp;of&nbsp;the&nbsp;input&nbsp;elements.&nbsp;The&nbsp;shape&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;`packed`&nbsp;has&nbsp;the&nbsp;same&nbsp;number&nbsp;of&nbsp;dimensions&nbsp;as&nbsp;the&nbsp;input&nbsp;(unless&nbsp;`axis`<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;the&nbsp;output&nbsp;is&nbsp;1-D).<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
unpackbits:&nbsp;Unpacks&nbsp;elements&nbsp;of&nbsp;a&nbsp;uint8&nbsp;array&nbsp;into&nbsp;a&nbsp;binary-valued&nbsp;output<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([[[1,0,1],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,1,0]],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[1,1,0],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,0,1]]])<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-packbits">packbits</a>(a,&nbsp;axis=-1)<br>
&gt;&gt;&gt;&nbsp;b<br>
<a href="#-array">array</a>([[[160],[64]],[[192],[32]]],&nbsp;dtype=uint8)<br>
&nbsp;<br>
Note&nbsp;that&nbsp;in&nbsp;binary&nbsp;160&nbsp;=&nbsp;1010&nbsp;0000,&nbsp;64&nbsp;=&nbsp;0100&nbsp;0000,&nbsp;192&nbsp;=&nbsp;1100&nbsp;0000,<br>
and&nbsp;32&nbsp;=&nbsp;0010&nbsp;0000.</tt></dd></dl>
 <dl><dt><a name="-pareto"><strong>pareto</strong></a>(...)</dt><dd><tt><a href="#-pareto">pareto</a>(a,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Pareto&nbsp;II&nbsp;or&nbsp;Lomax&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;shape.<br>
&nbsp;<br>
The&nbsp;Lomax&nbsp;or&nbsp;Pareto&nbsp;II&nbsp;distribution&nbsp;is&nbsp;a&nbsp;shifted&nbsp;Pareto&nbsp;distribution.&nbsp;The<br>
classical&nbsp;Pareto&nbsp;distribution&nbsp;can&nbsp;be&nbsp;obtained&nbsp;from&nbsp;the&nbsp;Lomax&nbsp;distribution<br>
by&nbsp;adding&nbsp;the&nbsp;location&nbsp;parameter&nbsp;m,&nbsp;see&nbsp;below.&nbsp;The&nbsp;smallest&nbsp;value&nbsp;of&nbsp;the<br>
Lomax&nbsp;distribution&nbsp;is&nbsp;zero&nbsp;while&nbsp;for&nbsp;the&nbsp;classical&nbsp;Pareto&nbsp;distribution&nbsp;it<br>
is&nbsp;m,&nbsp;where&nbsp;the&nbsp;standard&nbsp;Pareto&nbsp;distribution&nbsp;has&nbsp;location&nbsp;m=1.<br>
Lomax&nbsp;can&nbsp;also&nbsp;be&nbsp;considered&nbsp;as&nbsp;a&nbsp;simplified&nbsp;version&nbsp;of&nbsp;the&nbsp;Generalized<br>
Pareto&nbsp;distribution&nbsp;(available&nbsp;in&nbsp;SciPy),&nbsp;with&nbsp;the&nbsp;scale&nbsp;set&nbsp;to&nbsp;one&nbsp;and<br>
the&nbsp;location&nbsp;set&nbsp;to&nbsp;zero.<br>
&nbsp;<br>
The&nbsp;Pareto&nbsp;distribution&nbsp;must&nbsp;be&nbsp;greater&nbsp;than&nbsp;zero,&nbsp;and&nbsp;is&nbsp;unbounded&nbsp;above.<br>
It&nbsp;is&nbsp;also&nbsp;known&nbsp;as&nbsp;the&nbsp;"80-20&nbsp;rule".&nbsp;&nbsp;In&nbsp;this&nbsp;distribution,&nbsp;80&nbsp;percent&nbsp;of<br>
the&nbsp;weights&nbsp;are&nbsp;in&nbsp;the&nbsp;lowest&nbsp;20&nbsp;percent&nbsp;of&nbsp;the&nbsp;range,&nbsp;while&nbsp;the&nbsp;other&nbsp;20<br>
percent&nbsp;fill&nbsp;the&nbsp;remaining&nbsp;80&nbsp;percent&nbsp;of&nbsp;the&nbsp;range.<br>
&nbsp;<br>
Parameters<br>
----------<br>
shape&nbsp;:&nbsp;float,&nbsp;&gt;&nbsp;0.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Shape&nbsp;of&nbsp;the&nbsp;distribution.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.lomax.pdf&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
scipy.stats.distributions.genpareto.pdf&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Pareto&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{am^a}{x^{a+1}}<br>
&nbsp;<br>
where&nbsp;:math:`a`&nbsp;is&nbsp;the&nbsp;shape&nbsp;and&nbsp;:math:`m`&nbsp;the&nbsp;location<br>
&nbsp;<br>
The&nbsp;Pareto&nbsp;distribution,&nbsp;named&nbsp;after&nbsp;the&nbsp;Italian&nbsp;economist&nbsp;Vilfredo&nbsp;Pareto,<br>
is&nbsp;a&nbsp;power&nbsp;law&nbsp;probability&nbsp;distribution&nbsp;useful&nbsp;in&nbsp;many&nbsp;real&nbsp;world&nbsp;problems.<br>
Outside&nbsp;the&nbsp;field&nbsp;of&nbsp;economics&nbsp;it&nbsp;is&nbsp;generally&nbsp;referred&nbsp;to&nbsp;as&nbsp;the&nbsp;Bradford<br>
distribution.&nbsp;Pareto&nbsp;developed&nbsp;the&nbsp;distribution&nbsp;to&nbsp;describe&nbsp;the<br>
distribution&nbsp;of&nbsp;wealth&nbsp;in&nbsp;an&nbsp;economy.&nbsp;&nbsp;It&nbsp;has&nbsp;also&nbsp;found&nbsp;use&nbsp;in&nbsp;insurance,<br>
web&nbsp;page&nbsp;access&nbsp;statistics,&nbsp;oil&nbsp;field&nbsp;sizes,&nbsp;and&nbsp;many&nbsp;other&nbsp;problems,<br>
including&nbsp;the&nbsp;download&nbsp;frequency&nbsp;for&nbsp;projects&nbsp;in&nbsp;Sourceforge&nbsp;[1].&nbsp;&nbsp;It&nbsp;is<br>
one&nbsp;of&nbsp;the&nbsp;so-called&nbsp;"fat-tailed"&nbsp;distributions.<br>
&nbsp;<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Francis&nbsp;Hunt&nbsp;and&nbsp;Paul&nbsp;Johnson,&nbsp;On&nbsp;the&nbsp;Pareto&nbsp;Distribution&nbsp;of<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sourceforge&nbsp;projects.<br>
..&nbsp;[2]&nbsp;Pareto,&nbsp;V.&nbsp;(1896).&nbsp;Course&nbsp;of&nbsp;Political&nbsp;Economy.&nbsp;Lausanne.<br>
..&nbsp;[3]&nbsp;Reiss,&nbsp;R.D.,&nbsp;Thomas,&nbsp;M.(2001),&nbsp;Statistical&nbsp;Analysis&nbsp;of&nbsp;Extreme<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Values,&nbsp;Birkhauser&nbsp;Verlag,&nbsp;Basel,&nbsp;pp&nbsp;23-30.<br>
..&nbsp;[4]&nbsp;Wikipedia,&nbsp;"Pareto&nbsp;distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Pareto_distribution">http://en.wikipedia.org/wiki/Pareto_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a,&nbsp;m&nbsp;=&nbsp;3.,&nbsp;1.&nbsp;#&nbsp;shape&nbsp;and&nbsp;mode<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-pareto">pareto</a>(a,&nbsp;1000)&nbsp;+&nbsp;m<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;100,&nbsp;normed=True,&nbsp;align='center')<br>
&gt;&gt;&gt;&nbsp;fit&nbsp;=&nbsp;a*m**a/bins**(a+1)<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;max(count)*fit/max(fit),linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-permutation"><strong>permutation</strong></a>(...)</dt><dd><tt><a href="#-permutation">permutation</a>(x)<br>
&nbsp;<br>
Randomly&nbsp;permute&nbsp;a&nbsp;sequence,&nbsp;or&nbsp;return&nbsp;a&nbsp;permuted&nbsp;range.<br>
&nbsp;<br>
If&nbsp;`x`&nbsp;is&nbsp;a&nbsp;multi-dimensional&nbsp;array,&nbsp;it&nbsp;is&nbsp;only&nbsp;shuffled&nbsp;along&nbsp;its<br>
first&nbsp;index.<br>
&nbsp;<br>
Parameters<br>
----------<br>
x&nbsp;:&nbsp;int&nbsp;or&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`x`&nbsp;is&nbsp;an&nbsp;integer,&nbsp;randomly&nbsp;permute&nbsp;``np.<a href="#-arange">arange</a>(x)``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`x`&nbsp;is&nbsp;an&nbsp;array,&nbsp;make&nbsp;a&nbsp;copy&nbsp;and&nbsp;shuffle&nbsp;the&nbsp;elements<br>
&nbsp;&nbsp;&nbsp;&nbsp;randomly.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Permuted&nbsp;sequence&nbsp;or&nbsp;array&nbsp;range.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-permutation">permutation</a>(10)<br>
<a href="#-array">array</a>([1,&nbsp;7,&nbsp;4,&nbsp;3,&nbsp;0,&nbsp;9,&nbsp;2,&nbsp;5,&nbsp;8,&nbsp;6])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-permutation">permutation</a>([1,&nbsp;4,&nbsp;9,&nbsp;12,&nbsp;15])<br>
<a href="#-array">array</a>([15,&nbsp;&nbsp;1,&nbsp;&nbsp;9,&nbsp;&nbsp;4,&nbsp;12])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;arr&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(9).reshape((3,&nbsp;3))<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-permutation">permutation</a>(arr)<br>
<a href="#-array">array</a>([[6,&nbsp;7,&nbsp;8],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;1,&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4,&nbsp;5]])</tt></dd></dl>
 <dl><dt><a name="-poisson"><strong>poisson</strong></a>(...)</dt><dd><tt><a href="#-poisson">poisson</a>(lam=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Poisson&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;Poisson&nbsp;distribution&nbsp;is&nbsp;the&nbsp;limit&nbsp;of&nbsp;the&nbsp;Binomial<br>
distribution&nbsp;for&nbsp;large&nbsp;N.<br>
&nbsp;<br>
Parameters<br>
----------<br>
lam&nbsp;:&nbsp;float&nbsp;or&nbsp;sequence&nbsp;of&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Expectation&nbsp;of&nbsp;interval,&nbsp;should&nbsp;be&nbsp;&gt;=&nbsp;0.&nbsp;A&nbsp;sequence&nbsp;of&nbsp;expectation<br>
&nbsp;&nbsp;&nbsp;&nbsp;intervals&nbsp;must&nbsp;be&nbsp;broadcastable&nbsp;over&nbsp;the&nbsp;requested&nbsp;size.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;Poisson&nbsp;distribution<br>
&nbsp;<br>
..&nbsp;math::&nbsp;<a href="#-f">f</a>(k;&nbsp;\lambda)=\frac{\lambda^k&nbsp;e^{-\lambda}}{k!}<br>
&nbsp;<br>
For&nbsp;events&nbsp;with&nbsp;an&nbsp;expected&nbsp;separation&nbsp;:math:`\lambda`&nbsp;the&nbsp;Poisson<br>
distribution&nbsp;:math:`<a href="#-f">f</a>(k;&nbsp;\lambda)`&nbsp;describes&nbsp;the&nbsp;probability&nbsp;of<br>
:math:`k`&nbsp;events&nbsp;occurring&nbsp;within&nbsp;the&nbsp;observed&nbsp;interval&nbsp;:math:`\lambda`.<br>
&nbsp;<br>
Because&nbsp;the&nbsp;output&nbsp;is&nbsp;limited&nbsp;to&nbsp;the&nbsp;range&nbsp;of&nbsp;the&nbsp;C&nbsp;long&nbsp;type,&nbsp;a<br>
ValueError&nbsp;is&nbsp;raised&nbsp;when&nbsp;`lam`&nbsp;is&nbsp;within&nbsp;10&nbsp;sigma&nbsp;of&nbsp;the&nbsp;maximum<br>
representable&nbsp;value.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Poisson&nbsp;Distribution."&nbsp;From&nbsp;MathWorld--A&nbsp;Wolfram<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Web&nbsp;Resource.&nbsp;<a href="http://mathworld.wolfram.com/PoissonDistribution.html">http://mathworld.wolfram.com/PoissonDistribution.html</a><br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Poisson&nbsp;distribution",<br>
&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Poisson_distribution">http://en.wikipedia.org/wiki/Poisson_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;numpy&nbsp;as&nbsp;np<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-poisson">poisson</a>(5,&nbsp;10000)<br>
&nbsp;<br>
Display&nbsp;histogram&nbsp;of&nbsp;the&nbsp;sample:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;14,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.show()<br>
&nbsp;<br>
Draw&nbsp;each&nbsp;100&nbsp;values&nbsp;for&nbsp;lambda&nbsp;100&nbsp;and&nbsp;500:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-poisson">poisson</a>(lam=(100.,&nbsp;500.),&nbsp;size=(100,&nbsp;2))</tt></dd></dl>
 <dl><dt><a name="-power"><strong>power</strong></a>(...)</dt><dd><tt><a href="#-power">power</a>(a,&nbsp;size=None)<br>
&nbsp;<br>
Draws&nbsp;samples&nbsp;in&nbsp;[0,&nbsp;1]&nbsp;from&nbsp;a&nbsp;power&nbsp;distribution&nbsp;with&nbsp;positive<br>
exponent&nbsp;a&nbsp;-&nbsp;1.<br>
&nbsp;<br>
Also&nbsp;known&nbsp;as&nbsp;the&nbsp;power&nbsp;function&nbsp;distribution.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;parameter,&nbsp;&gt;&nbsp;0<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;{ndarray,&nbsp;scalar}<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;returned&nbsp;samples&nbsp;lie&nbsp;in&nbsp;[0,&nbsp;1].<br>
&nbsp;<br>
Raises<br>
------<br>
ValueError<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&lt;1.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x;&nbsp;a)&nbsp;=&nbsp;ax^{a-1},&nbsp;0&nbsp;\le&nbsp;x&nbsp;\le&nbsp;1,&nbsp;a&gt;0.<br>
&nbsp;<br>
The&nbsp;power&nbsp;function&nbsp;distribution&nbsp;is&nbsp;just&nbsp;the&nbsp;inverse&nbsp;of&nbsp;the&nbsp;Pareto<br>
distribution.&nbsp;It&nbsp;may&nbsp;also&nbsp;be&nbsp;seen&nbsp;as&nbsp;a&nbsp;special&nbsp;case&nbsp;of&nbsp;the&nbsp;Beta<br>
distribution.<br>
&nbsp;<br>
It&nbsp;is&nbsp;used,&nbsp;for&nbsp;example,&nbsp;in&nbsp;modeling&nbsp;the&nbsp;over-reporting&nbsp;of&nbsp;insurance<br>
claims.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Christian&nbsp;Kleiber,&nbsp;Samuel&nbsp;Kotz,&nbsp;"Statistical&nbsp;size&nbsp;distributions<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;economics&nbsp;and&nbsp;actuarial&nbsp;sciences",&nbsp;Wiley,&nbsp;2003.<br>
..&nbsp;[2]&nbsp;Heckert,&nbsp;N.&nbsp;A.&nbsp;and&nbsp;Filliben,&nbsp;James&nbsp;J.&nbsp;(2003).&nbsp;NIST&nbsp;Handbook&nbsp;148:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dataplot&nbsp;Reference&nbsp;Manual,&nbsp;Volume&nbsp;2:&nbsp;Let&nbsp;Subcommands&nbsp;and&nbsp;Library<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Functions",&nbsp;National&nbsp;Institute&nbsp;of&nbsp;Standards&nbsp;and&nbsp;Technology&nbsp;Handbook<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Series,&nbsp;June&nbsp;2003.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/powpdf.pdf">http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/powpdf.pdf</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;5.&nbsp;#&nbsp;shape<br>
&gt;&gt;&gt;&nbsp;samples&nbsp;=&nbsp;1000<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-power">power</a>(a,&nbsp;samples)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;bins=30)<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.linspace(0,&nbsp;1,&nbsp;100)<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;a*x**(a-1.)<br>
&gt;&gt;&gt;&nbsp;normed_y&nbsp;=&nbsp;samples*np.diff(bins)[0]*y<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;normed_y)<br>
&gt;&gt;&gt;&nbsp;plt.show()<br>
&nbsp;<br>
Compare&nbsp;the&nbsp;power&nbsp;function&nbsp;distribution&nbsp;to&nbsp;the&nbsp;inverse&nbsp;of&nbsp;the&nbsp;Pareto.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;from&nbsp;scipy&nbsp;import&nbsp;stats<br>
&gt;&gt;&gt;&nbsp;rvs&nbsp;=&nbsp;np.random.<a href="#-power">power</a>(5,&nbsp;1000000)<br>
&gt;&gt;&gt;&nbsp;rvsp&nbsp;=&nbsp;np.random.<a href="#-pareto">pareto</a>(5,&nbsp;1000000)<br>
&gt;&gt;&gt;&nbsp;xx&nbsp;=&nbsp;np.linspace(0,1,100)<br>
&gt;&gt;&gt;&nbsp;powpdf&nbsp;=&nbsp;stats.powerlaw.pdf(xx,5)<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.figure()<br>
&gt;&gt;&gt;&nbsp;plt.hist(rvs,&nbsp;bins=50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(xx,powpdf,'r-')<br>
&gt;&gt;&gt;&nbsp;plt.title('np.random.<a href="#-power">power</a>(5)')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.figure()<br>
&gt;&gt;&gt;&nbsp;plt.hist(1./(1.+rvsp),&nbsp;bins=50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(xx,powpdf,'r-')<br>
&gt;&gt;&gt;&nbsp;plt.title('inverse&nbsp;of&nbsp;1&nbsp;+&nbsp;np.random.<a href="#-pareto">pareto</a>(5)')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;plt.figure()<br>
&gt;&gt;&gt;&nbsp;plt.hist(1./(1.+rvsp),&nbsp;bins=50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(xx,powpdf,'r-')<br>
&gt;&gt;&gt;&nbsp;plt.title('inverse&nbsp;of&nbsp;stats.<a href="#-pareto">pareto</a>(5)')</tt></dd></dl>
 <dl><dt><a name="-promote_types"><strong>promote_types</strong></a>(...)</dt><dd><tt><a href="#-promote_types">promote_types</a>(type1,&nbsp;type2)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;data&nbsp;type&nbsp;with&nbsp;the&nbsp;smallest&nbsp;size&nbsp;and&nbsp;smallest&nbsp;scalar<br>
kind&nbsp;to&nbsp;which&nbsp;both&nbsp;``type1``&nbsp;and&nbsp;``type2``&nbsp;may&nbsp;be&nbsp;safely&nbsp;cast.<br>
The&nbsp;returned&nbsp;data&nbsp;type&nbsp;is&nbsp;always&nbsp;in&nbsp;native&nbsp;byte&nbsp;order.<br>
&nbsp;<br>
This&nbsp;function&nbsp;is&nbsp;symmetric&nbsp;and&nbsp;associative.<br>
&nbsp;<br>
Parameters<br>
----------<br>
type1&nbsp;:&nbsp;dtype&nbsp;or&nbsp;dtype&nbsp;specifier<br>
&nbsp;&nbsp;&nbsp;&nbsp;First&nbsp;data&nbsp;type.<br>
type2&nbsp;:&nbsp;dtype&nbsp;or&nbsp;dtype&nbsp;specifier<br>
&nbsp;&nbsp;&nbsp;&nbsp;Second&nbsp;data&nbsp;type.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;dtype<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;promoted&nbsp;data&nbsp;type.<br>
&nbsp;<br>
Notes<br>
-----<br>
..&nbsp;versionadded::&nbsp;1.6.0<br>
Starting&nbsp;in&nbsp;NumPy&nbsp;1.9,&nbsp;promote_types&nbsp;function&nbsp;now&nbsp;returns&nbsp;a&nbsp;valid&nbsp;string<br>
length&nbsp;when&nbsp;given&nbsp;an&nbsp;integer&nbsp;or&nbsp;float&nbsp;dtype&nbsp;as&nbsp;one&nbsp;argument&nbsp;and&nbsp;a&nbsp;string<br>
dtype&nbsp;as&nbsp;another&nbsp;argument.&nbsp;Previously&nbsp;it&nbsp;always&nbsp;returned&nbsp;the&nbsp;input&nbsp;string<br>
dtype,&nbsp;even&nbsp;if&nbsp;it&nbsp;wasn't&nbsp;long&nbsp;enough&nbsp;to&nbsp;store&nbsp;the&nbsp;max&nbsp;integer/float&nbsp;value<br>
converted&nbsp;to&nbsp;a&nbsp;string.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
result_type,&nbsp;dtype,&nbsp;can_cast<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-promote_types">promote_types</a>('f4',&nbsp;'f8')<br>
dtype('float64')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-promote_types">promote_types</a>('i8',&nbsp;'f4')<br>
dtype('float64')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-promote_types">promote_types</a>('&gt;i8',&nbsp;'&lt;c8')<br>
dtype('complex128')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-promote_types">promote_types</a>('i4',&nbsp;'S8')<br>
dtype('S11')</tt></dd></dl>
 <dl><dt><a name="-putmask"><strong>putmask</strong></a>(...)</dt><dd><tt><a href="#-putmask">putmask</a>(a,&nbsp;mask,&nbsp;values)<br>
&nbsp;<br>
Changes&nbsp;elements&nbsp;of&nbsp;an&nbsp;array&nbsp;based&nbsp;on&nbsp;conditional&nbsp;and&nbsp;input&nbsp;values.<br>
&nbsp;<br>
Sets&nbsp;``a.flat[n]&nbsp;=&nbsp;values[n]``&nbsp;for&nbsp;each&nbsp;n&nbsp;where&nbsp;``mask.flat[n]==True``.<br>
&nbsp;<br>
If&nbsp;`values`&nbsp;is&nbsp;not&nbsp;the&nbsp;same&nbsp;size&nbsp;as&nbsp;`a`&nbsp;and&nbsp;`mask`&nbsp;then&nbsp;it&nbsp;will&nbsp;repeat.<br>
This&nbsp;gives&nbsp;behavior&nbsp;different&nbsp;from&nbsp;``a[mask]&nbsp;=&nbsp;values``.<br>
&nbsp;<br>
..&nbsp;note::&nbsp;The&nbsp;`putmask`&nbsp;functionality&nbsp;is&nbsp;also&nbsp;provided&nbsp;by&nbsp;`copyto`,&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;be&nbsp;significantly&nbsp;faster&nbsp;and&nbsp;in&nbsp;addition&nbsp;is&nbsp;NA-aware<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(`preservena`&nbsp;keyword).&nbsp;&nbsp;Replacing&nbsp;`putmask`&nbsp;with<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;``np.<a href="#-copyto">copyto</a>(a,&nbsp;values,&nbsp;where=mask)``&nbsp;is&nbsp;recommended.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Target&nbsp;array.<br>
mask&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Boolean&nbsp;mask&nbsp;array.&nbsp;It&nbsp;has&nbsp;to&nbsp;be&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;`a`.<br>
values&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Values&nbsp;to&nbsp;put&nbsp;into&nbsp;`a`&nbsp;where&nbsp;`mask`&nbsp;is&nbsp;True.&nbsp;If&nbsp;`values`&nbsp;is&nbsp;smaller<br>
&nbsp;&nbsp;&nbsp;&nbsp;than&nbsp;`a`&nbsp;it&nbsp;will&nbsp;be&nbsp;repeated.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
place,&nbsp;put,&nbsp;take,&nbsp;copyto<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(6).reshape(2,&nbsp;3)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-putmask">putmask</a>(x,&nbsp;x&gt;2,&nbsp;x**2)<br>
&gt;&gt;&gt;&nbsp;x<br>
<a href="#-array">array</a>([[&nbsp;0,&nbsp;&nbsp;1,&nbsp;&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;9,&nbsp;16,&nbsp;25]])<br>
&nbsp;<br>
If&nbsp;`values`&nbsp;is&nbsp;smaller&nbsp;than&nbsp;`a`&nbsp;it&nbsp;is&nbsp;repeated:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(5)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-putmask">putmask</a>(x,&nbsp;x&gt;1,&nbsp;[-33,&nbsp;-44])<br>
&gt;&gt;&gt;&nbsp;x<br>
<a href="#-array">array</a>([&nbsp;&nbsp;0,&nbsp;&nbsp;&nbsp;1,&nbsp;-33,&nbsp;-44,&nbsp;-33])</tt></dd></dl>
 <dl><dt><a name="-rand"><strong>rand</strong></a>(...)</dt><dd><tt><a href="#-rand">rand</a>(d0,&nbsp;d1,&nbsp;...,&nbsp;dn)<br>
&nbsp;<br>
Random&nbsp;values&nbsp;in&nbsp;a&nbsp;given&nbsp;shape.<br>
&nbsp;<br>
Create&nbsp;an&nbsp;array&nbsp;of&nbsp;the&nbsp;given&nbsp;shape&nbsp;and&nbsp;propagate&nbsp;it&nbsp;with<br>
random&nbsp;samples&nbsp;from&nbsp;a&nbsp;uniform&nbsp;distribution<br>
over&nbsp;``[0,&nbsp;1)``.<br>
&nbsp;<br>
Parameters<br>
----------<br>
d0,&nbsp;d1,&nbsp;...,&nbsp;dn&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;dimensions&nbsp;of&nbsp;the&nbsp;returned&nbsp;array,&nbsp;should&nbsp;all&nbsp;be&nbsp;positive.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;no&nbsp;argument&nbsp;is&nbsp;given&nbsp;a&nbsp;single&nbsp;Python&nbsp;float&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray,&nbsp;shape&nbsp;``(d0,&nbsp;d1,&nbsp;...,&nbsp;dn)``<br>
&nbsp;&nbsp;&nbsp;&nbsp;Random&nbsp;values.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
random<br>
&nbsp;<br>
Notes<br>
-----<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;function.&nbsp;If&nbsp;you&nbsp;want&nbsp;an&nbsp;interface&nbsp;that<br>
takes&nbsp;a&nbsp;shape-tuple&nbsp;as&nbsp;the&nbsp;first&nbsp;argument,&nbsp;refer&nbsp;to<br>
np.random.random_sample&nbsp;.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-rand">rand</a>(3,2)<br>
<a href="#-array">array</a>([[&nbsp;0.14022471,&nbsp;&nbsp;0.96360618],&nbsp;&nbsp;#random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.37601032,&nbsp;&nbsp;0.25528411],&nbsp;&nbsp;#random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.49313049,&nbsp;&nbsp;0.94909878]])&nbsp;#random</tt></dd></dl>
 <dl><dt><a name="-randint"><strong>randint</strong></a>(...)</dt><dd><tt><a href="#-randint">randint</a>(low,&nbsp;high=None,&nbsp;size=None)<br>
&nbsp;<br>
Return&nbsp;random&nbsp;integers&nbsp;from&nbsp;`low`&nbsp;(inclusive)&nbsp;to&nbsp;`high`&nbsp;(exclusive).<br>
&nbsp;<br>
Return&nbsp;random&nbsp;integers&nbsp;from&nbsp;the&nbsp;"discrete&nbsp;uniform"&nbsp;distribution&nbsp;in&nbsp;the<br>
"half-open"&nbsp;interval&nbsp;[`low`,&nbsp;`high`).&nbsp;If&nbsp;`high`&nbsp;is&nbsp;None&nbsp;(the&nbsp;default),<br>
then&nbsp;results&nbsp;are&nbsp;from&nbsp;[0,&nbsp;`low`).<br>
&nbsp;<br>
Parameters<br>
----------<br>
low&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Lowest&nbsp;(signed)&nbsp;integer&nbsp;to&nbsp;be&nbsp;drawn&nbsp;from&nbsp;the&nbsp;distribution&nbsp;(unless<br>
&nbsp;&nbsp;&nbsp;&nbsp;``high=None``,&nbsp;in&nbsp;which&nbsp;case&nbsp;this&nbsp;parameter&nbsp;is&nbsp;the&nbsp;*highest*&nbsp;such<br>
&nbsp;&nbsp;&nbsp;&nbsp;integer).<br>
high&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;one&nbsp;above&nbsp;the&nbsp;largest&nbsp;(signed)&nbsp;integer&nbsp;to&nbsp;be&nbsp;drawn<br>
&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;the&nbsp;distribution&nbsp;(see&nbsp;above&nbsp;for&nbsp;behavior&nbsp;if&nbsp;``high=None``).<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;int&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;`size`-shaped&nbsp;array&nbsp;of&nbsp;random&nbsp;integers&nbsp;from&nbsp;the&nbsp;appropriate<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution,&nbsp;or&nbsp;a&nbsp;single&nbsp;such&nbsp;random&nbsp;int&nbsp;if&nbsp;`size`&nbsp;not&nbsp;provided.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
random.random_integers&nbsp;:&nbsp;similar&nbsp;to&nbsp;`randint`,&nbsp;only&nbsp;for&nbsp;the&nbsp;closed<br>
&nbsp;&nbsp;&nbsp;&nbsp;interval&nbsp;[`low`,&nbsp;`high`],&nbsp;and&nbsp;1&nbsp;is&nbsp;the&nbsp;lowest&nbsp;value&nbsp;if&nbsp;`high`&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;omitted.&nbsp;In&nbsp;particular,&nbsp;this&nbsp;other&nbsp;one&nbsp;is&nbsp;the&nbsp;one&nbsp;to&nbsp;use&nbsp;to&nbsp;generate<br>
&nbsp;&nbsp;&nbsp;&nbsp;uniformly&nbsp;distributed&nbsp;discrete&nbsp;non-integers.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-randint">randint</a>(2,&nbsp;size=10)<br>
<a href="#-array">array</a>([1,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;1,&nbsp;1,&nbsp;0,&nbsp;0,&nbsp;1,&nbsp;0])<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-randint">randint</a>(1,&nbsp;size=10)<br>
<a href="#-array">array</a>([0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0])<br>
&nbsp;<br>
Generate&nbsp;a&nbsp;2&nbsp;x&nbsp;4&nbsp;array&nbsp;of&nbsp;ints&nbsp;between&nbsp;0&nbsp;and&nbsp;4,&nbsp;inclusive:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-randint">randint</a>(5,&nbsp;size=(2,&nbsp;4))<br>
<a href="#-array">array</a>([[4,&nbsp;0,&nbsp;2,&nbsp;1],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;2,&nbsp;2,&nbsp;0]])</tt></dd></dl>
 <dl><dt><a name="-randn"><strong>randn</strong></a>(...)</dt><dd><tt><a href="#-randn">randn</a>(d0,&nbsp;d1,&nbsp;...,&nbsp;dn)<br>
&nbsp;<br>
Return&nbsp;a&nbsp;sample&nbsp;(or&nbsp;samples)&nbsp;from&nbsp;the&nbsp;"standard&nbsp;normal"&nbsp;distribution.<br>
&nbsp;<br>
If&nbsp;positive,&nbsp;int_like&nbsp;or&nbsp;int-convertible&nbsp;arguments&nbsp;are&nbsp;provided,<br>
`randn`&nbsp;generates&nbsp;an&nbsp;array&nbsp;of&nbsp;shape&nbsp;``(d0,&nbsp;d1,&nbsp;...,&nbsp;dn)``,&nbsp;filled<br>
with&nbsp;random&nbsp;floats&nbsp;sampled&nbsp;from&nbsp;a&nbsp;univariate&nbsp;"normal"&nbsp;(Gaussian)<br>
distribution&nbsp;of&nbsp;mean&nbsp;0&nbsp;and&nbsp;variance&nbsp;1&nbsp;(if&nbsp;any&nbsp;of&nbsp;the&nbsp;:math:`d_i`&nbsp;are<br>
floats,&nbsp;they&nbsp;are&nbsp;first&nbsp;converted&nbsp;to&nbsp;integers&nbsp;by&nbsp;truncation).&nbsp;A&nbsp;single<br>
float&nbsp;randomly&nbsp;sampled&nbsp;from&nbsp;the&nbsp;distribution&nbsp;is&nbsp;returned&nbsp;if&nbsp;no<br>
argument&nbsp;is&nbsp;provided.<br>
&nbsp;<br>
This&nbsp;is&nbsp;a&nbsp;convenience&nbsp;function.&nbsp;&nbsp;If&nbsp;you&nbsp;want&nbsp;an&nbsp;interface&nbsp;that&nbsp;takes&nbsp;a<br>
tuple&nbsp;as&nbsp;the&nbsp;first&nbsp;argument,&nbsp;use&nbsp;`numpy.random.standard_normal`&nbsp;instead.<br>
&nbsp;<br>
Parameters<br>
----------<br>
d0,&nbsp;d1,&nbsp;...,&nbsp;dn&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;dimensions&nbsp;of&nbsp;the&nbsp;returned&nbsp;array,&nbsp;should&nbsp;be&nbsp;all&nbsp;positive.<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;no&nbsp;argument&nbsp;is&nbsp;given&nbsp;a&nbsp;single&nbsp;Python&nbsp;float&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
Z&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;``(d0,&nbsp;d1,&nbsp;...,&nbsp;dn)``-shaped&nbsp;array&nbsp;of&nbsp;floating-point&nbsp;samples&nbsp;from<br>
&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;standard&nbsp;normal&nbsp;distribution,&nbsp;or&nbsp;a&nbsp;single&nbsp;such&nbsp;float&nbsp;if<br>
&nbsp;&nbsp;&nbsp;&nbsp;no&nbsp;parameters&nbsp;were&nbsp;supplied.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
random.standard_normal&nbsp;:&nbsp;Similar,&nbsp;but&nbsp;takes&nbsp;a&nbsp;tuple&nbsp;as&nbsp;its&nbsp;argument.<br>
&nbsp;<br>
Notes<br>
-----<br>
For&nbsp;random&nbsp;samples&nbsp;from&nbsp;:math:`N(\mu,&nbsp;\sigma^2)`,&nbsp;use:<br>
&nbsp;<br>
``sigma&nbsp;*&nbsp;np.random.<a href="#-randn">randn</a>(...)&nbsp;+&nbsp;mu``<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-randn">randn</a>()<br>
2.1923875335537315&nbsp;#random<br>
&nbsp;<br>
Two-by-four&nbsp;array&nbsp;of&nbsp;samples&nbsp;from&nbsp;N(3,&nbsp;6.25):<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;2.5&nbsp;*&nbsp;np.random.<a href="#-randn">randn</a>(2,&nbsp;4)&nbsp;+&nbsp;3<br>
<a href="#-array">array</a>([[-4.49401501,&nbsp;&nbsp;4.00950034,&nbsp;-1.81814867,&nbsp;&nbsp;7.29718677],&nbsp;&nbsp;#random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.39924804,&nbsp;&nbsp;4.68456316,&nbsp;&nbsp;4.99394529,&nbsp;&nbsp;4.84057254]])&nbsp;#random</tt></dd></dl>
 <dl><dt><a name="-random"><strong>random</strong></a> = random_sample(...)</dt><dd><tt><a href="#-random_sample">random_sample</a>(size=None)<br>
&nbsp;<br>
Return&nbsp;random&nbsp;floats&nbsp;in&nbsp;the&nbsp;half-open&nbsp;interval&nbsp;[0.0,&nbsp;1.0).<br>
&nbsp;<br>
Results&nbsp;are&nbsp;from&nbsp;the&nbsp;"continuous&nbsp;uniform"&nbsp;distribution&nbsp;over&nbsp;the<br>
stated&nbsp;interval.&nbsp;&nbsp;To&nbsp;sample&nbsp;:math:`Unif[a,&nbsp;b),&nbsp;b&nbsp;&gt;&nbsp;a`&nbsp;multiply<br>
the&nbsp;output&nbsp;of&nbsp;`random_sample`&nbsp;by&nbsp;`(b-a)`&nbsp;and&nbsp;add&nbsp;`a`::<br>
&nbsp;<br>
&nbsp;&nbsp;(b&nbsp;-&nbsp;a)&nbsp;*&nbsp;<a href="#-random_sample">random_sample</a>()&nbsp;+&nbsp;a<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;float&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;floats<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;random&nbsp;floats&nbsp;of&nbsp;shape&nbsp;`size`&nbsp;(unless&nbsp;``size=None``,&nbsp;in&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;a&nbsp;single&nbsp;float&nbsp;is&nbsp;returned).<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>()<br>
0.47108547995356098<br>
&gt;&gt;&gt;&nbsp;type(np.random.<a href="#-random_sample">random_sample</a>())<br>
&lt;type&nbsp;'float'&gt;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>((5,))<br>
<a href="#-array">array</a>([&nbsp;0.30220482,&nbsp;&nbsp;0.86820401,&nbsp;&nbsp;0.1654503&nbsp;,&nbsp;&nbsp;0.11659149,&nbsp;&nbsp;0.54323428])<br>
&nbsp;<br>
Three-by-two&nbsp;array&nbsp;of&nbsp;random&nbsp;numbers&nbsp;from&nbsp;[-5,&nbsp;0):<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;5&nbsp;*&nbsp;np.random.<a href="#-random_sample">random_sample</a>((3,&nbsp;2))&nbsp;-&nbsp;5<br>
<a href="#-array">array</a>([[-3.99149989,&nbsp;-0.52338984],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-2.99091858,&nbsp;-0.79479508],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-1.23204345,&nbsp;-1.75224494]])</tt></dd></dl>
 <dl><dt><a name="-random_integers"><strong>random_integers</strong></a>(...)</dt><dd><tt><a href="#-random_integers">random_integers</a>(low,&nbsp;high=None,&nbsp;size=None)<br>
&nbsp;<br>
Return&nbsp;random&nbsp;integers&nbsp;between&nbsp;`low`&nbsp;and&nbsp;`high`,&nbsp;inclusive.<br>
&nbsp;<br>
Return&nbsp;random&nbsp;integers&nbsp;from&nbsp;the&nbsp;"discrete&nbsp;uniform"&nbsp;distribution&nbsp;in&nbsp;the<br>
closed&nbsp;interval&nbsp;[`low`,&nbsp;`high`].&nbsp;&nbsp;If&nbsp;`high`&nbsp;is&nbsp;None&nbsp;(the&nbsp;default),<br>
then&nbsp;results&nbsp;are&nbsp;from&nbsp;[1,&nbsp;`low`].<br>
&nbsp;<br>
Parameters<br>
----------<br>
low&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Lowest&nbsp;(signed)&nbsp;integer&nbsp;to&nbsp;be&nbsp;drawn&nbsp;from&nbsp;the&nbsp;distribution&nbsp;(unless<br>
&nbsp;&nbsp;&nbsp;&nbsp;``high=None``,&nbsp;in&nbsp;which&nbsp;case&nbsp;this&nbsp;parameter&nbsp;is&nbsp;the&nbsp;*highest*&nbsp;such<br>
&nbsp;&nbsp;&nbsp;&nbsp;integer).<br>
high&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;provided,&nbsp;the&nbsp;largest&nbsp;(signed)&nbsp;integer&nbsp;to&nbsp;be&nbsp;drawn&nbsp;from&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;(see&nbsp;above&nbsp;for&nbsp;behavior&nbsp;if&nbsp;``high=None``).<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;int&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;`size`-shaped&nbsp;array&nbsp;of&nbsp;random&nbsp;integers&nbsp;from&nbsp;the&nbsp;appropriate<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution,&nbsp;or&nbsp;a&nbsp;single&nbsp;such&nbsp;random&nbsp;int&nbsp;if&nbsp;`size`&nbsp;not&nbsp;provided.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
random.randint&nbsp;:&nbsp;Similar&nbsp;to&nbsp;`random_integers`,&nbsp;only&nbsp;for&nbsp;the&nbsp;half-open<br>
&nbsp;&nbsp;&nbsp;&nbsp;interval&nbsp;[`low`,&nbsp;`high`),&nbsp;and&nbsp;0&nbsp;is&nbsp;the&nbsp;lowest&nbsp;value&nbsp;if&nbsp;`high`&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;omitted.<br>
&nbsp;<br>
Notes<br>
-----<br>
To&nbsp;sample&nbsp;from&nbsp;N&nbsp;evenly&nbsp;spaced&nbsp;floating-point&nbsp;numbers&nbsp;between&nbsp;a&nbsp;and&nbsp;b,<br>
use::<br>
&nbsp;<br>
&nbsp;&nbsp;a&nbsp;+&nbsp;(b&nbsp;-&nbsp;a)&nbsp;*&nbsp;(np.random.<a href="#-random_integers">random_integers</a>(N)&nbsp;-&nbsp;1)&nbsp;/&nbsp;(N&nbsp;-&nbsp;1.)<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_integers">random_integers</a>(5)<br>
4<br>
&gt;&gt;&gt;&nbsp;type(np.random.<a href="#-random_integers">random_integers</a>(5))<br>
&lt;type&nbsp;'int'&gt;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_integers">random_integers</a>(5,&nbsp;size=(3.,2.))<br>
<a href="#-array">array</a>([[5,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;3],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[4,&nbsp;5]])<br>
&nbsp;<br>
Choose&nbsp;five&nbsp;random&nbsp;numbers&nbsp;from&nbsp;the&nbsp;set&nbsp;of&nbsp;five&nbsp;evenly-spaced<br>
numbers&nbsp;between&nbsp;0&nbsp;and&nbsp;2.5,&nbsp;inclusive&nbsp;(*i.e.*,&nbsp;from&nbsp;the&nbsp;set<br>
:math:`{0,&nbsp;5/8,&nbsp;10/8,&nbsp;15/8,&nbsp;20/8}`):<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;2.5&nbsp;*&nbsp;(np.random.<a href="#-random_integers">random_integers</a>(5,&nbsp;size=(5,))&nbsp;-&nbsp;1)&nbsp;/&nbsp;4.<br>
<a href="#-array">array</a>([&nbsp;0.625,&nbsp;&nbsp;1.25&nbsp;,&nbsp;&nbsp;0.625,&nbsp;&nbsp;0.625,&nbsp;&nbsp;2.5&nbsp;&nbsp;])<br>
&nbsp;<br>
Roll&nbsp;two&nbsp;six&nbsp;sided&nbsp;dice&nbsp;1000&nbsp;times&nbsp;and&nbsp;sum&nbsp;the&nbsp;results:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;d1&nbsp;=&nbsp;np.random.<a href="#-random_integers">random_integers</a>(1,&nbsp;6,&nbsp;1000)<br>
&gt;&gt;&gt;&nbsp;d2&nbsp;=&nbsp;np.random.<a href="#-random_integers">random_integers</a>(1,&nbsp;6,&nbsp;1000)<br>
&gt;&gt;&gt;&nbsp;dsums&nbsp;=&nbsp;d1&nbsp;+&nbsp;d2<br>
&nbsp;<br>
Display&nbsp;results&nbsp;as&nbsp;a&nbsp;histogram:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(dsums,&nbsp;11,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-random_sample"><strong>random_sample</strong></a>(...)</dt><dd><tt><a href="#-random_sample">random_sample</a>(size=None)<br>
&nbsp;<br>
Return&nbsp;random&nbsp;floats&nbsp;in&nbsp;the&nbsp;half-open&nbsp;interval&nbsp;[0.0,&nbsp;1.0).<br>
&nbsp;<br>
Results&nbsp;are&nbsp;from&nbsp;the&nbsp;"continuous&nbsp;uniform"&nbsp;distribution&nbsp;over&nbsp;the<br>
stated&nbsp;interval.&nbsp;&nbsp;To&nbsp;sample&nbsp;:math:`Unif[a,&nbsp;b),&nbsp;b&nbsp;&gt;&nbsp;a`&nbsp;multiply<br>
the&nbsp;output&nbsp;of&nbsp;`random_sample`&nbsp;by&nbsp;`(b-a)`&nbsp;and&nbsp;add&nbsp;`a`::<br>
&nbsp;<br>
&nbsp;&nbsp;(b&nbsp;-&nbsp;a)&nbsp;*&nbsp;<a href="#-random_sample">random_sample</a>()&nbsp;+&nbsp;a<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;float&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;floats<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;random&nbsp;floats&nbsp;of&nbsp;shape&nbsp;`size`&nbsp;(unless&nbsp;``size=None``,&nbsp;in&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;a&nbsp;single&nbsp;float&nbsp;is&nbsp;returned).<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>()<br>
0.47108547995356098<br>
&gt;&gt;&gt;&nbsp;type(np.random.<a href="#-random_sample">random_sample</a>())<br>
&lt;type&nbsp;'float'&gt;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>((5,))<br>
<a href="#-array">array</a>([&nbsp;0.30220482,&nbsp;&nbsp;0.86820401,&nbsp;&nbsp;0.1654503&nbsp;,&nbsp;&nbsp;0.11659149,&nbsp;&nbsp;0.54323428])<br>
&nbsp;<br>
Three-by-two&nbsp;array&nbsp;of&nbsp;random&nbsp;numbers&nbsp;from&nbsp;[-5,&nbsp;0):<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;5&nbsp;*&nbsp;np.random.<a href="#-random_sample">random_sample</a>((3,&nbsp;2))&nbsp;-&nbsp;5<br>
<a href="#-array">array</a>([[-3.99149989,&nbsp;-0.52338984],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-2.99091858,&nbsp;-0.79479508],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-1.23204345,&nbsp;-1.75224494]])</tt></dd></dl>
 <dl><dt><a name="-ranf"><strong>ranf</strong></a> = random_sample(...)</dt><dd><tt><a href="#-random_sample">random_sample</a>(size=None)<br>
&nbsp;<br>
Return&nbsp;random&nbsp;floats&nbsp;in&nbsp;the&nbsp;half-open&nbsp;interval&nbsp;[0.0,&nbsp;1.0).<br>
&nbsp;<br>
Results&nbsp;are&nbsp;from&nbsp;the&nbsp;"continuous&nbsp;uniform"&nbsp;distribution&nbsp;over&nbsp;the<br>
stated&nbsp;interval.&nbsp;&nbsp;To&nbsp;sample&nbsp;:math:`Unif[a,&nbsp;b),&nbsp;b&nbsp;&gt;&nbsp;a`&nbsp;multiply<br>
the&nbsp;output&nbsp;of&nbsp;`random_sample`&nbsp;by&nbsp;`(b-a)`&nbsp;and&nbsp;add&nbsp;`a`::<br>
&nbsp;<br>
&nbsp;&nbsp;(b&nbsp;-&nbsp;a)&nbsp;*&nbsp;<a href="#-random_sample">random_sample</a>()&nbsp;+&nbsp;a<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;float&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;floats<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;random&nbsp;floats&nbsp;of&nbsp;shape&nbsp;`size`&nbsp;(unless&nbsp;``size=None``,&nbsp;in&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;a&nbsp;single&nbsp;float&nbsp;is&nbsp;returned).<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>()<br>
0.47108547995356098<br>
&gt;&gt;&gt;&nbsp;type(np.random.<a href="#-random_sample">random_sample</a>())<br>
&lt;type&nbsp;'float'&gt;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>((5,))<br>
<a href="#-array">array</a>([&nbsp;0.30220482,&nbsp;&nbsp;0.86820401,&nbsp;&nbsp;0.1654503&nbsp;,&nbsp;&nbsp;0.11659149,&nbsp;&nbsp;0.54323428])<br>
&nbsp;<br>
Three-by-two&nbsp;array&nbsp;of&nbsp;random&nbsp;numbers&nbsp;from&nbsp;[-5,&nbsp;0):<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;5&nbsp;*&nbsp;np.random.<a href="#-random_sample">random_sample</a>((3,&nbsp;2))&nbsp;-&nbsp;5<br>
<a href="#-array">array</a>([[-3.99149989,&nbsp;-0.52338984],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-2.99091858,&nbsp;-0.79479508],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-1.23204345,&nbsp;-1.75224494]])</tt></dd></dl>
 <dl><dt><a name="-ravel_multi_index"><strong>ravel_multi_index</strong></a>(...)</dt><dd><tt><a href="#-ravel_multi_index">ravel_multi_index</a>(multi_index,&nbsp;dims,&nbsp;mode='raise',&nbsp;order='C')<br>
&nbsp;<br>
Converts&nbsp;a&nbsp;tuple&nbsp;of&nbsp;index&nbsp;arrays&nbsp;into&nbsp;an&nbsp;array&nbsp;of&nbsp;flat<br>
indices,&nbsp;applying&nbsp;boundary&nbsp;modes&nbsp;to&nbsp;the&nbsp;multi-index.<br>
&nbsp;<br>
Parameters<br>
----------<br>
multi_index&nbsp;:&nbsp;tuple&nbsp;of&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;tuple&nbsp;of&nbsp;integer&nbsp;arrays,&nbsp;one&nbsp;array&nbsp;for&nbsp;each&nbsp;dimension.<br>
dims&nbsp;:&nbsp;tuple&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;shape&nbsp;of&nbsp;array&nbsp;into&nbsp;which&nbsp;the&nbsp;indices&nbsp;from&nbsp;``multi_index``&nbsp;apply.<br>
mode&nbsp;:&nbsp;{'raise',&nbsp;'wrap',&nbsp;'clip'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Specifies&nbsp;how&nbsp;out-of-bounds&nbsp;indices&nbsp;are&nbsp;handled.&nbsp;&nbsp;Can&nbsp;specify<br>
&nbsp;&nbsp;&nbsp;&nbsp;either&nbsp;one&nbsp;mode&nbsp;or&nbsp;a&nbsp;tuple&nbsp;of&nbsp;modes,&nbsp;one&nbsp;mode&nbsp;per&nbsp;index.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'raise'&nbsp;--&nbsp;raise&nbsp;an&nbsp;error&nbsp;(default)<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'wrap'&nbsp;--&nbsp;wrap&nbsp;around<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;'clip'&nbsp;--&nbsp;clip&nbsp;to&nbsp;the&nbsp;range<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;'clip'&nbsp;mode,&nbsp;a&nbsp;negative&nbsp;index&nbsp;which&nbsp;would&nbsp;normally<br>
&nbsp;&nbsp;&nbsp;&nbsp;wrap&nbsp;will&nbsp;clip&nbsp;to&nbsp;0&nbsp;instead.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Determines&nbsp;whether&nbsp;the&nbsp;multi-index&nbsp;should&nbsp;be&nbsp;viewed&nbsp;as&nbsp;indexing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;C&nbsp;(row-major)&nbsp;order&nbsp;or&nbsp;FORTRAN&nbsp;(column-major)&nbsp;order.<br>
&nbsp;<br>
Returns<br>
-------<br>
raveled_indices&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;of&nbsp;indices&nbsp;into&nbsp;the&nbsp;flattened&nbsp;version&nbsp;of&nbsp;an&nbsp;array<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;dimensions&nbsp;``dims``.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
unravel_index<br>
&nbsp;<br>
Notes<br>
-----<br>
..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;arr&nbsp;=&nbsp;np.<a href="#-array">array</a>([[3,6,6],[4,5,1]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-ravel_multi_index">ravel_multi_index</a>(arr,&nbsp;(7,6))<br>
<a href="#-array">array</a>([22,&nbsp;41,&nbsp;37])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-ravel_multi_index">ravel_multi_index</a>(arr,&nbsp;(7,6),&nbsp;order='F')<br>
<a href="#-array">array</a>([31,&nbsp;41,&nbsp;13])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-ravel_multi_index">ravel_multi_index</a>(arr,&nbsp;(4,6),&nbsp;mode='clip')<br>
<a href="#-array">array</a>([22,&nbsp;23,&nbsp;19])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-ravel_multi_index">ravel_multi_index</a>(arr,&nbsp;(4,4),&nbsp;mode=('clip','wrap'))<br>
<a href="#-array">array</a>([12,&nbsp;13,&nbsp;13])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-ravel_multi_index">ravel_multi_index</a>((3,1,4,1),&nbsp;(6,7,8,9))<br>
1621</tt></dd></dl>
 <dl><dt><a name="-rayleigh"><strong>rayleigh</strong></a>(...)</dt><dd><tt><a href="#-rayleigh">rayleigh</a>(scale=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Rayleigh&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;:math:`\chi`&nbsp;and&nbsp;Weibull&nbsp;distributions&nbsp;are&nbsp;generalizations&nbsp;of&nbsp;the<br>
Rayleigh.<br>
&nbsp;<br>
Parameters<br>
----------<br>
scale&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Scale,&nbsp;also&nbsp;equals&nbsp;the&nbsp;mode.&nbsp;Should&nbsp;be&nbsp;&gt;=&nbsp;0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;Rayleigh&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x;scale)&nbsp;=&nbsp;\frac{x}{scale^2}e^{\frac{-x^2}{2&nbsp;\cdotp&nbsp;scale^2}}<br>
&nbsp;<br>
The&nbsp;Rayleigh&nbsp;distribution&nbsp;arises&nbsp;if&nbsp;the&nbsp;wind&nbsp;speed&nbsp;and&nbsp;wind&nbsp;direction&nbsp;are<br>
both&nbsp;gaussian&nbsp;variables,&nbsp;then&nbsp;the&nbsp;vector&nbsp;wind&nbsp;velocity&nbsp;forms&nbsp;a&nbsp;Rayleigh<br>
distribution.&nbsp;The&nbsp;Rayleigh&nbsp;distribution&nbsp;is&nbsp;used&nbsp;to&nbsp;model&nbsp;the&nbsp;expected<br>
output&nbsp;from&nbsp;wind&nbsp;turbines.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Brighton&nbsp;Webs&nbsp;Ltd.,&nbsp;Rayleigh&nbsp;Distribution,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.brighton-webs.co.uk/distributions/rayleigh.asp">http://www.brighton-webs.co.uk/distributions/rayleigh.asp</a><br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Rayleigh&nbsp;distribution"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Rayleigh_distribution">http://en.wikipedia.org/wiki/Rayleigh_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;values&nbsp;from&nbsp;the&nbsp;distribution&nbsp;and&nbsp;plot&nbsp;the&nbsp;histogram<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;values&nbsp;=&nbsp;hist(np.random.<a href="#-rayleigh">rayleigh</a>(3,&nbsp;100000),&nbsp;bins=200,&nbsp;normed=True)<br>
&nbsp;<br>
Wave&nbsp;heights&nbsp;tend&nbsp;to&nbsp;follow&nbsp;a&nbsp;Rayleigh&nbsp;distribution.&nbsp;If&nbsp;the&nbsp;mean&nbsp;wave<br>
height&nbsp;is&nbsp;1&nbsp;meter,&nbsp;what&nbsp;fraction&nbsp;of&nbsp;waves&nbsp;are&nbsp;likely&nbsp;to&nbsp;be&nbsp;larger&nbsp;than&nbsp;3<br>
meters?<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;meanvalue&nbsp;=&nbsp;1<br>
&gt;&gt;&gt;&nbsp;modevalue&nbsp;=&nbsp;np.sqrt(2&nbsp;/&nbsp;np.pi)&nbsp;*&nbsp;meanvalue<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-rayleigh">rayleigh</a>(modevalue,&nbsp;1000000)<br>
&nbsp;<br>
The&nbsp;percentage&nbsp;of&nbsp;waves&nbsp;larger&nbsp;than&nbsp;3&nbsp;meters&nbsp;is:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;100.*sum(s&gt;3)/1000000.<br>
0.087300000000000003</tt></dd></dl>
 <dl><dt><a name="-restoredot"><strong>restoredot</strong></a>(...)</dt><dd><tt>Restore&nbsp;`dot`,&nbsp;`vdot`,&nbsp;and&nbsp;`innerproduct`&nbsp;to&nbsp;the&nbsp;default&nbsp;non-BLAS<br>
implementations.<br>
&nbsp;<br>
Typically,&nbsp;the&nbsp;user&nbsp;will&nbsp;only&nbsp;need&nbsp;to&nbsp;call&nbsp;this&nbsp;when&nbsp;troubleshooting&nbsp;and<br>
installation&nbsp;problem,&nbsp;reproducing&nbsp;the&nbsp;conditions&nbsp;of&nbsp;a&nbsp;build&nbsp;without&nbsp;an<br>
accelerated&nbsp;BLAS,&nbsp;or&nbsp;when&nbsp;being&nbsp;very&nbsp;careful&nbsp;about&nbsp;benchmarking&nbsp;linear<br>
algebra&nbsp;operations.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
alterdot&nbsp;:&nbsp;`restoredot`&nbsp;undoes&nbsp;the&nbsp;effects&nbsp;of&nbsp;`alterdot`.</tt></dd></dl>
 <dl><dt><a name="-result_type"><strong>result_type</strong></a>(...)</dt><dd><tt><a href="#-result_type">result_type</a>(*arrays_and_dtypes)<br>
&nbsp;<br>
Returns&nbsp;the&nbsp;type&nbsp;that&nbsp;results&nbsp;from&nbsp;applying&nbsp;the&nbsp;NumPy<br>
type&nbsp;promotion&nbsp;rules&nbsp;to&nbsp;the&nbsp;arguments.<br>
&nbsp;<br>
Type&nbsp;promotion&nbsp;in&nbsp;NumPy&nbsp;works&nbsp;similarly&nbsp;to&nbsp;the&nbsp;rules&nbsp;in&nbsp;languages<br>
like&nbsp;C++,&nbsp;with&nbsp;some&nbsp;slight&nbsp;differences.&nbsp;&nbsp;When&nbsp;both&nbsp;scalars&nbsp;and<br>
arrays&nbsp;are&nbsp;used,&nbsp;the&nbsp;array's&nbsp;type&nbsp;takes&nbsp;precedence&nbsp;and&nbsp;the&nbsp;actual&nbsp;value<br>
of&nbsp;the&nbsp;scalar&nbsp;is&nbsp;taken&nbsp;into&nbsp;account.<br>
&nbsp;<br>
For&nbsp;example,&nbsp;calculating&nbsp;3*a,&nbsp;where&nbsp;a&nbsp;is&nbsp;an&nbsp;array&nbsp;of&nbsp;32-bit&nbsp;floats,<br>
intuitively&nbsp;should&nbsp;result&nbsp;in&nbsp;a&nbsp;32-bit&nbsp;float&nbsp;output.&nbsp;&nbsp;If&nbsp;the&nbsp;3&nbsp;is&nbsp;a<br>
32-bit&nbsp;integer,&nbsp;the&nbsp;NumPy&nbsp;rules&nbsp;indicate&nbsp;it&nbsp;can't&nbsp;convert&nbsp;losslessly<br>
into&nbsp;a&nbsp;32-bit&nbsp;float,&nbsp;so&nbsp;a&nbsp;64-bit&nbsp;float&nbsp;should&nbsp;be&nbsp;the&nbsp;result&nbsp;type.<br>
By&nbsp;examining&nbsp;the&nbsp;value&nbsp;of&nbsp;the&nbsp;constant,&nbsp;'3',&nbsp;we&nbsp;see&nbsp;that&nbsp;it&nbsp;fits&nbsp;in<br>
an&nbsp;8-bit&nbsp;integer,&nbsp;which&nbsp;can&nbsp;be&nbsp;cast&nbsp;losslessly&nbsp;into&nbsp;the&nbsp;32-bit&nbsp;float.<br>
&nbsp;<br>
Parameters<br>
----------<br>
arrays_and_dtypes&nbsp;:&nbsp;list&nbsp;of&nbsp;arrays&nbsp;and&nbsp;dtypes<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;operands&nbsp;of&nbsp;some&nbsp;operation&nbsp;whose&nbsp;result&nbsp;type&nbsp;is&nbsp;needed.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;dtype<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;result&nbsp;type.<br>
&nbsp;<br>
See&nbsp;also<br>
--------<br>
dtype,&nbsp;promote_types,&nbsp;min_scalar_type,&nbsp;can_cast<br>
&nbsp;<br>
Notes<br>
-----<br>
..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;<br>
The&nbsp;specific&nbsp;algorithm&nbsp;used&nbsp;is&nbsp;as&nbsp;follows.<br>
&nbsp;<br>
Categories&nbsp;are&nbsp;determined&nbsp;by&nbsp;first&nbsp;checking&nbsp;which&nbsp;of&nbsp;boolean,<br>
integer&nbsp;(int/uint),&nbsp;or&nbsp;floating&nbsp;point&nbsp;(float/complex)&nbsp;the&nbsp;maximum<br>
kind&nbsp;of&nbsp;all&nbsp;the&nbsp;arrays&nbsp;and&nbsp;the&nbsp;scalars&nbsp;are.<br>
&nbsp;<br>
If&nbsp;there&nbsp;are&nbsp;only&nbsp;scalars&nbsp;or&nbsp;the&nbsp;maximum&nbsp;category&nbsp;of&nbsp;the&nbsp;scalars<br>
is&nbsp;higher&nbsp;than&nbsp;the&nbsp;maximum&nbsp;category&nbsp;of&nbsp;the&nbsp;arrays,<br>
the&nbsp;data&nbsp;types&nbsp;are&nbsp;combined&nbsp;with&nbsp;:func:`promote_types`<br>
to&nbsp;produce&nbsp;the&nbsp;return&nbsp;value.<br>
&nbsp;<br>
Otherwise,&nbsp;`min_scalar_type`&nbsp;is&nbsp;called&nbsp;on&nbsp;each&nbsp;array,&nbsp;and<br>
the&nbsp;resulting&nbsp;data&nbsp;types&nbsp;are&nbsp;all&nbsp;combined&nbsp;with&nbsp;:func:`promote_types`<br>
to&nbsp;produce&nbsp;the&nbsp;return&nbsp;value.<br>
&nbsp;<br>
The&nbsp;set&nbsp;of&nbsp;int&nbsp;values&nbsp;is&nbsp;not&nbsp;a&nbsp;subset&nbsp;of&nbsp;the&nbsp;uint&nbsp;values&nbsp;for&nbsp;types<br>
with&nbsp;the&nbsp;same&nbsp;number&nbsp;of&nbsp;bits,&nbsp;something&nbsp;not&nbsp;reflected&nbsp;in<br>
:func:`min_scalar_type`,&nbsp;but&nbsp;handled&nbsp;as&nbsp;a&nbsp;special&nbsp;case&nbsp;in&nbsp;`result_type`.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-result_type">result_type</a>(3,&nbsp;np.<a href="#-arange">arange</a>(7,&nbsp;dtype='i1'))<br>
dtype('int8')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-result_type">result_type</a>('i4',&nbsp;'c8')<br>
dtype('complex128')<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-result_type">result_type</a>(3.0,&nbsp;-2)<br>
dtype('float64')</tt></dd></dl>
 <dl><dt><a name="-sample"><strong>sample</strong></a> = random_sample(...)</dt><dd><tt><a href="#-random_sample">random_sample</a>(size=None)<br>
&nbsp;<br>
Return&nbsp;random&nbsp;floats&nbsp;in&nbsp;the&nbsp;half-open&nbsp;interval&nbsp;[0.0,&nbsp;1.0).<br>
&nbsp;<br>
Results&nbsp;are&nbsp;from&nbsp;the&nbsp;"continuous&nbsp;uniform"&nbsp;distribution&nbsp;over&nbsp;the<br>
stated&nbsp;interval.&nbsp;&nbsp;To&nbsp;sample&nbsp;:math:`Unif[a,&nbsp;b),&nbsp;b&nbsp;&gt;&nbsp;a`&nbsp;multiply<br>
the&nbsp;output&nbsp;of&nbsp;`random_sample`&nbsp;by&nbsp;`(b-a)`&nbsp;and&nbsp;add&nbsp;`a`::<br>
&nbsp;<br>
&nbsp;&nbsp;(b&nbsp;-&nbsp;a)&nbsp;*&nbsp;<a href="#-random_sample">random_sample</a>()&nbsp;+&nbsp;a<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;float&nbsp;or&nbsp;ndarray&nbsp;of&nbsp;floats<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;random&nbsp;floats&nbsp;of&nbsp;shape&nbsp;`size`&nbsp;(unless&nbsp;``size=None``,&nbsp;in&nbsp;which<br>
&nbsp;&nbsp;&nbsp;&nbsp;case&nbsp;a&nbsp;single&nbsp;float&nbsp;is&nbsp;returned).<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>()<br>
0.47108547995356098<br>
&gt;&gt;&gt;&nbsp;type(np.random.<a href="#-random_sample">random_sample</a>())<br>
&lt;type&nbsp;'float'&gt;<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-random_sample">random_sample</a>((5,))<br>
<a href="#-array">array</a>([&nbsp;0.30220482,&nbsp;&nbsp;0.86820401,&nbsp;&nbsp;0.1654503&nbsp;,&nbsp;&nbsp;0.11659149,&nbsp;&nbsp;0.54323428])<br>
&nbsp;<br>
Three-by-two&nbsp;array&nbsp;of&nbsp;random&nbsp;numbers&nbsp;from&nbsp;[-5,&nbsp;0):<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;5&nbsp;*&nbsp;np.random.<a href="#-random_sample">random_sample</a>((3,&nbsp;2))&nbsp;-&nbsp;5<br>
<a href="#-array">array</a>([[-3.99149989,&nbsp;-0.52338984],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-2.99091858,&nbsp;-0.79479508],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-1.23204345,&nbsp;-1.75224494]])</tt></dd></dl>
 <dl><dt><a name="-seed"><strong>seed</strong></a>(...)</dt><dd><tt><a href="#-seed">seed</a>(seed=None)<br>
&nbsp;<br>
Seed&nbsp;the&nbsp;generator.<br>
&nbsp;<br>
This&nbsp;method&nbsp;is&nbsp;called&nbsp;when&nbsp;`RandomState`&nbsp;is&nbsp;initialized.&nbsp;It&nbsp;can&nbsp;be<br>
called&nbsp;again&nbsp;to&nbsp;re-seed&nbsp;the&nbsp;generator.&nbsp;For&nbsp;details,&nbsp;see&nbsp;`RandomState`.<br>
&nbsp;<br>
Parameters<br>
----------<br>
seed&nbsp;:&nbsp;int&nbsp;or&nbsp;array_like,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Seed&nbsp;for&nbsp;`RandomState`.<br>
&nbsp;&nbsp;&nbsp;&nbsp;Must&nbsp;be&nbsp;convertable&nbsp;to&nbsp;32&nbsp;bit&nbsp;unsigned&nbsp;integers.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
RandomState</tt></dd></dl>
 <dl><dt><a name="-set_numeric_ops"><strong>set_numeric_ops</strong></a>(...)</dt><dd><tt><a href="#-set_numeric_ops">set_numeric_ops</a>(op1=func1,&nbsp;op2=func2,&nbsp;...)<br>
&nbsp;<br>
Set&nbsp;numerical&nbsp;operators&nbsp;for&nbsp;array&nbsp;objects.<br>
&nbsp;<br>
Parameters<br>
----------<br>
op1,&nbsp;op2,&nbsp;...&nbsp;:&nbsp;callable<br>
&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;``op&nbsp;=&nbsp;func``&nbsp;pair&nbsp;describes&nbsp;an&nbsp;operator&nbsp;to&nbsp;be&nbsp;replaced.<br>
&nbsp;&nbsp;&nbsp;&nbsp;For&nbsp;example,&nbsp;``add&nbsp;=&nbsp;lambda&nbsp;x,&nbsp;y:&nbsp;np.add(x,&nbsp;y)&nbsp;%&nbsp;5``&nbsp;would&nbsp;replace<br>
&nbsp;&nbsp;&nbsp;&nbsp;addition&nbsp;by&nbsp;modulus&nbsp;5&nbsp;addition.<br>
&nbsp;<br>
Returns<br>
-------<br>
saved_ops&nbsp;:&nbsp;list&nbsp;of&nbsp;callables<br>
&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;all&nbsp;operators,&nbsp;stored&nbsp;before&nbsp;making&nbsp;replacements.<br>
&nbsp;<br>
Notes<br>
-----<br>
..&nbsp;WARNING::<br>
&nbsp;&nbsp;&nbsp;Use&nbsp;with&nbsp;care!&nbsp;&nbsp;Incorrect&nbsp;usage&nbsp;may&nbsp;lead&nbsp;to&nbsp;memory&nbsp;errors.<br>
&nbsp;<br>
A&nbsp;function&nbsp;replacing&nbsp;an&nbsp;operator&nbsp;cannot&nbsp;make&nbsp;use&nbsp;of&nbsp;that&nbsp;operator.<br>
For&nbsp;example,&nbsp;when&nbsp;replacing&nbsp;add,&nbsp;you&nbsp;may&nbsp;not&nbsp;use&nbsp;``+``.&nbsp;&nbsp;Instead,<br>
directly&nbsp;call&nbsp;ufuncs.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;def&nbsp;add_mod5(x,&nbsp;y):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;np.add(x,&nbsp;y)&nbsp;%&nbsp;5<br>
...<br>
&gt;&gt;&gt;&nbsp;old_funcs&nbsp;=&nbsp;np.<a href="#-set_numeric_ops">set_numeric_ops</a>(add=add_mod5)<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(12).reshape((3,&nbsp;4))<br>
&gt;&gt;&gt;&nbsp;x&nbsp;+&nbsp;x<br>
<a href="#-array">array</a>([[0,&nbsp;2,&nbsp;4,&nbsp;1],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;0,&nbsp;2,&nbsp;4],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[1,&nbsp;3,&nbsp;0,&nbsp;2]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;ignore&nbsp;=&nbsp;np.<a href="#-set_numeric_ops">set_numeric_ops</a>(**old_funcs)&nbsp;#&nbsp;restore&nbsp;operators</tt></dd></dl>
 <dl><dt><a name="-set_state"><strong>set_state</strong></a>(...)</dt><dd><tt><a href="#-set_state">set_state</a>(state)<br>
&nbsp;<br>
Set&nbsp;the&nbsp;internal&nbsp;state&nbsp;of&nbsp;the&nbsp;generator&nbsp;from&nbsp;a&nbsp;tuple.<br>
&nbsp;<br>
For&nbsp;use&nbsp;if&nbsp;one&nbsp;has&nbsp;reason&nbsp;to&nbsp;manually&nbsp;(re-)set&nbsp;the&nbsp;internal&nbsp;state&nbsp;of&nbsp;the<br>
"Mersenne&nbsp;Twister"[1]_&nbsp;pseudo-random&nbsp;number&nbsp;generating&nbsp;algorithm.<br>
&nbsp;<br>
Parameters<br>
----------<br>
state&nbsp;:&nbsp;tuple(str,&nbsp;ndarray&nbsp;of&nbsp;624&nbsp;uints,&nbsp;int,&nbsp;int,&nbsp;float)<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;`state`&nbsp;tuple&nbsp;has&nbsp;the&nbsp;following&nbsp;items:<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;1.&nbsp;the&nbsp;string&nbsp;'MT19937',&nbsp;specifying&nbsp;the&nbsp;Mersenne&nbsp;Twister&nbsp;algorithm.<br>
&nbsp;&nbsp;&nbsp;&nbsp;2.&nbsp;a&nbsp;1-D&nbsp;array&nbsp;of&nbsp;624&nbsp;unsigned&nbsp;integers&nbsp;``keys``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;3.&nbsp;an&nbsp;integer&nbsp;``pos``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;an&nbsp;integer&nbsp;``has_gauss``.<br>
&nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;a&nbsp;float&nbsp;``cached_gaussian``.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;None<br>
&nbsp;&nbsp;&nbsp;&nbsp;Returns&nbsp;'None'&nbsp;on&nbsp;success.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
get_state<br>
&nbsp;<br>
Notes<br>
-----<br>
`set_state`&nbsp;and&nbsp;`get_state`&nbsp;are&nbsp;not&nbsp;needed&nbsp;to&nbsp;work&nbsp;with&nbsp;any&nbsp;of&nbsp;the<br>
random&nbsp;distributions&nbsp;in&nbsp;NumPy.&nbsp;If&nbsp;the&nbsp;internal&nbsp;state&nbsp;is&nbsp;manually&nbsp;altered,<br>
the&nbsp;user&nbsp;should&nbsp;know&nbsp;exactly&nbsp;what&nbsp;he/she&nbsp;is&nbsp;doing.<br>
&nbsp;<br>
For&nbsp;backwards&nbsp;compatibility,&nbsp;the&nbsp;form&nbsp;(str,&nbsp;array&nbsp;of&nbsp;624&nbsp;uints,&nbsp;int)&nbsp;is<br>
also&nbsp;accepted&nbsp;although&nbsp;it&nbsp;is&nbsp;missing&nbsp;some&nbsp;information&nbsp;about&nbsp;the&nbsp;cached<br>
Gaussian&nbsp;value:&nbsp;``state&nbsp;=&nbsp;('MT19937',&nbsp;keys,&nbsp;pos)``.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;M.&nbsp;Matsumoto&nbsp;and&nbsp;T.&nbsp;Nishimura,&nbsp;"Mersenne&nbsp;Twister:&nbsp;A<br>
&nbsp;&nbsp;&nbsp;623-dimensionally&nbsp;equidistributed&nbsp;uniform&nbsp;pseudorandom&nbsp;number<br>
&nbsp;&nbsp;&nbsp;generator,"&nbsp;*ACM&nbsp;Trans.&nbsp;on&nbsp;Modeling&nbsp;and&nbsp;Computer&nbsp;Simulation*,<br>
&nbsp;&nbsp;&nbsp;Vol.&nbsp;8,&nbsp;No.&nbsp;1,&nbsp;pp.&nbsp;3-30,&nbsp;Jan.&nbsp;1998.</tt></dd></dl>
 <dl><dt><a name="-seterrobj"><strong>seterrobj</strong></a>(...)</dt><dd><tt><a href="#-seterrobj">seterrobj</a>(errobj)<br>
&nbsp;<br>
Set&nbsp;the&nbsp;object&nbsp;that&nbsp;defines&nbsp;floating-point&nbsp;error&nbsp;handling.<br>
&nbsp;<br>
The&nbsp;error&nbsp;object&nbsp;contains&nbsp;all&nbsp;information&nbsp;that&nbsp;defines&nbsp;the&nbsp;error&nbsp;handling<br>
behavior&nbsp;in&nbsp;Numpy.&nbsp;`seterrobj`&nbsp;is&nbsp;used&nbsp;internally&nbsp;by&nbsp;the&nbsp;other<br>
functions&nbsp;that&nbsp;set&nbsp;error&nbsp;handling&nbsp;behavior&nbsp;(`seterr`,&nbsp;`seterrcall`).<br>
&nbsp;<br>
Parameters<br>
----------<br>
errobj&nbsp;:&nbsp;list<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;error&nbsp;object,&nbsp;a&nbsp;list&nbsp;containing&nbsp;three&nbsp;elements:<br>
&nbsp;&nbsp;&nbsp;&nbsp;[internal&nbsp;numpy&nbsp;buffer&nbsp;size,&nbsp;error&nbsp;mask,&nbsp;error&nbsp;callback&nbsp;function].<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;error&nbsp;mask&nbsp;is&nbsp;a&nbsp;single&nbsp;integer&nbsp;that&nbsp;holds&nbsp;the&nbsp;treatment&nbsp;information<br>
&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;all&nbsp;four&nbsp;floating&nbsp;point&nbsp;errors.&nbsp;The&nbsp;information&nbsp;for&nbsp;each&nbsp;error&nbsp;type<br>
&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;contained&nbsp;in&nbsp;three&nbsp;bits&nbsp;of&nbsp;the&nbsp;integer.&nbsp;If&nbsp;we&nbsp;print&nbsp;it&nbsp;in&nbsp;base&nbsp;8,&nbsp;we<br>
&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;see&nbsp;what&nbsp;treatment&nbsp;is&nbsp;set&nbsp;for&nbsp;"invalid",&nbsp;"under",&nbsp;"over",&nbsp;and<br>
&nbsp;&nbsp;&nbsp;&nbsp;"divide"&nbsp;(in&nbsp;that&nbsp;order).&nbsp;The&nbsp;printed&nbsp;string&nbsp;can&nbsp;be&nbsp;interpreted&nbsp;with<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;0&nbsp;:&nbsp;'ignore'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;1&nbsp;:&nbsp;'warn'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;2&nbsp;:&nbsp;'raise'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;3&nbsp;:&nbsp;'call'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;4&nbsp;:&nbsp;'print'<br>
&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;5&nbsp;:&nbsp;'log'<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
geterrobj,&nbsp;seterr,&nbsp;geterr,&nbsp;seterrcall,&nbsp;geterrcall<br>
getbufsize,&nbsp;setbufsize<br>
&nbsp;<br>
Notes<br>
-----<br>
For&nbsp;complete&nbsp;documentation&nbsp;of&nbsp;the&nbsp;types&nbsp;of&nbsp;floating-point&nbsp;exceptions&nbsp;and<br>
treatment&nbsp;options,&nbsp;see&nbsp;`seterr`.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;old_errobj&nbsp;=&nbsp;np.<a href="#-geterrobj">geterrobj</a>()&nbsp;&nbsp;#&nbsp;first&nbsp;get&nbsp;the&nbsp;defaults<br>
&gt;&gt;&gt;&nbsp;old_errobj<br>
[10000,&nbsp;0,&nbsp;None]<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;def&nbsp;err_handler(type,&nbsp;flag):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;"Floating&nbsp;point&nbsp;error&nbsp;(%s),&nbsp;with&nbsp;flag&nbsp;%s"&nbsp;%&nbsp;(type,&nbsp;flag)<br>
...<br>
&gt;&gt;&gt;&nbsp;new_errobj&nbsp;=&nbsp;[20000,&nbsp;12,&nbsp;err_handler]<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-seterrobj">seterrobj</a>(new_errobj)<br>
&gt;&gt;&gt;&nbsp;np.base_repr(12,&nbsp;8)&nbsp;&nbsp;#&nbsp;int&nbsp;for&nbsp;divide=4&nbsp;('print')&nbsp;and&nbsp;over=1&nbsp;('warn')<br>
'14'<br>
&gt;&gt;&gt;&nbsp;np.geterr()<br>
{'over':&nbsp;'warn',&nbsp;'divide':&nbsp;'print',&nbsp;'invalid':&nbsp;'ignore',&nbsp;'under':&nbsp;'ignore'}<br>
&gt;&gt;&gt;&nbsp;np.geterrcall()&nbsp;is&nbsp;err_handler<br>
True</tt></dd></dl>
 <dl><dt><a name="-shuffle"><strong>shuffle</strong></a>(...)</dt><dd><tt><a href="#-shuffle">shuffle</a>(x)<br>
&nbsp;<br>
Modify&nbsp;a&nbsp;sequence&nbsp;in-place&nbsp;by&nbsp;shuffling&nbsp;its&nbsp;contents.<br>
&nbsp;<br>
Parameters<br>
----------<br>
x&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;array&nbsp;or&nbsp;list&nbsp;to&nbsp;be&nbsp;shuffled.<br>
&nbsp;<br>
Returns<br>
-------<br>
None<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;arr&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(10)<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-shuffle">shuffle</a>(arr)<br>
&gt;&gt;&gt;&nbsp;arr<br>
[1&nbsp;7&nbsp;5&nbsp;2&nbsp;9&nbsp;4&nbsp;3&nbsp;6&nbsp;0&nbsp;8]<br>
&nbsp;<br>
This&nbsp;function&nbsp;only&nbsp;shuffles&nbsp;the&nbsp;array&nbsp;along&nbsp;the&nbsp;first&nbsp;index&nbsp;of&nbsp;a<br>
multi-dimensional&nbsp;array:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;arr&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(9).reshape((3,&nbsp;3))<br>
&gt;&gt;&gt;&nbsp;np.random.<a href="#-shuffle">shuffle</a>(arr)<br>
&gt;&gt;&gt;&nbsp;arr<br>
<a href="#-array">array</a>([[3,&nbsp;4,&nbsp;5],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[6,&nbsp;7,&nbsp;8],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;1,&nbsp;2]])</tt></dd></dl>
 <dl><dt><a name="-standard_cauchy"><strong>standard_cauchy</strong></a>(...)</dt><dd><tt><a href="#-standard_cauchy">standard_cauchy</a>(size=None)<br>
&nbsp;<br>
Standard&nbsp;Cauchy&nbsp;distribution&nbsp;with&nbsp;mode&nbsp;=&nbsp;0.<br>
&nbsp;<br>
Also&nbsp;known&nbsp;as&nbsp;the&nbsp;Lorentz&nbsp;distribution.<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;drawn&nbsp;samples.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;full&nbsp;Cauchy&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x;&nbsp;x_0,&nbsp;\gamma)&nbsp;=&nbsp;\frac{1}{\pi&nbsp;\gamma&nbsp;\bigl[&nbsp;1+<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(\frac{x-x_0}{\gamma})^2&nbsp;\bigr]&nbsp;}<br>
&nbsp;<br>
and&nbsp;the&nbsp;Standard&nbsp;Cauchy&nbsp;distribution&nbsp;just&nbsp;sets&nbsp;:math:`x_0=0`&nbsp;and<br>
:math:`\gamma=1`<br>
&nbsp;<br>
The&nbsp;Cauchy&nbsp;distribution&nbsp;arises&nbsp;in&nbsp;the&nbsp;solution&nbsp;to&nbsp;the&nbsp;driven&nbsp;harmonic<br>
oscillator&nbsp;problem,&nbsp;and&nbsp;also&nbsp;describes&nbsp;spectral&nbsp;line&nbsp;broadening.&nbsp;It<br>
also&nbsp;describes&nbsp;the&nbsp;distribution&nbsp;of&nbsp;values&nbsp;at&nbsp;which&nbsp;a&nbsp;line&nbsp;tilted&nbsp;at<br>
a&nbsp;random&nbsp;angle&nbsp;will&nbsp;cut&nbsp;the&nbsp;x&nbsp;axis.<br>
&nbsp;<br>
When&nbsp;studying&nbsp;hypothesis&nbsp;tests&nbsp;that&nbsp;assume&nbsp;normality,&nbsp;seeing&nbsp;how&nbsp;the<br>
tests&nbsp;perform&nbsp;on&nbsp;data&nbsp;from&nbsp;a&nbsp;Cauchy&nbsp;distribution&nbsp;is&nbsp;a&nbsp;good&nbsp;indicator&nbsp;of<br>
their&nbsp;sensitivity&nbsp;to&nbsp;a&nbsp;heavy-tailed&nbsp;distribution,&nbsp;since&nbsp;the&nbsp;Cauchy&nbsp;looks<br>
very&nbsp;much&nbsp;like&nbsp;a&nbsp;Gaussian&nbsp;distribution,&nbsp;but&nbsp;with&nbsp;heavier&nbsp;tails.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;NIST/SEMATECH&nbsp;e-Handbook&nbsp;of&nbsp;Statistical&nbsp;Methods,&nbsp;"Cauchy<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm">http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm</a><br>
..&nbsp;[2]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Cauchy&nbsp;Distribution."&nbsp;From&nbsp;MathWorld--A<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/CauchyDistribution.html">http://mathworld.wolfram.com/CauchyDistribution.html</a><br>
..&nbsp;[3]&nbsp;Wikipedia,&nbsp;"Cauchy&nbsp;distribution"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Cauchy_distribution">http://en.wikipedia.org/wiki/Cauchy_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;and&nbsp;plot&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-standard_cauchy">standard_cauchy</a>(1000000)<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;s[(s&gt;-25)&nbsp;&amp;&nbsp;(s&lt;25)]&nbsp;&nbsp;#&nbsp;truncate&nbsp;distribution&nbsp;so&nbsp;it&nbsp;plots&nbsp;well<br>
&gt;&gt;&gt;&nbsp;plt.hist(s,&nbsp;bins=100)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-standard_exponential"><strong>standard_exponential</strong></a>(...)</dt><dd><tt><a href="#-standard_exponential">standard_exponential</a>(size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;standard&nbsp;exponential&nbsp;distribution.<br>
&nbsp;<br>
`standard_exponential`&nbsp;is&nbsp;identical&nbsp;to&nbsp;the&nbsp;exponential&nbsp;distribution<br>
with&nbsp;a&nbsp;scale&nbsp;parameter&nbsp;of&nbsp;1.<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;float&nbsp;or&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;samples.<br>
&nbsp;<br>
Examples<br>
--------<br>
Output&nbsp;a&nbsp;3x8000&nbsp;array:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;n&nbsp;=&nbsp;np.random.<a href="#-standard_exponential">standard_exponential</a>((3,&nbsp;8000))</tt></dd></dl>
 <dl><dt><a name="-standard_gamma"><strong>standard_gamma</strong></a>(...)</dt><dd><tt><a href="#-standard_gamma">standard_gamma</a>(shape,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Standard&nbsp;Gamma&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Gamma&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;parameters,<br>
shape&nbsp;(sometimes&nbsp;designated&nbsp;"k")&nbsp;and&nbsp;scale=1.<br>
&nbsp;<br>
Parameters<br>
----------<br>
shape&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Parameter,&nbsp;should&nbsp;be&nbsp;&gt;&nbsp;0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;drawn&nbsp;samples.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.gamma&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Gamma&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;x^{k-1}\frac{e^{-x/\theta}}{\theta^k\Gamma(k)},<br>
&nbsp;<br>
where&nbsp;:math:`k`&nbsp;is&nbsp;the&nbsp;shape&nbsp;and&nbsp;:math:`\theta`&nbsp;the&nbsp;scale,<br>
and&nbsp;:math:`\Gamma`&nbsp;is&nbsp;the&nbsp;Gamma&nbsp;function.<br>
&nbsp;<br>
The&nbsp;Gamma&nbsp;distribution&nbsp;is&nbsp;often&nbsp;used&nbsp;to&nbsp;model&nbsp;the&nbsp;times&nbsp;to&nbsp;failure&nbsp;of<br>
electronic&nbsp;components,&nbsp;and&nbsp;arises&nbsp;naturally&nbsp;in&nbsp;processes&nbsp;for&nbsp;which&nbsp;the<br>
waiting&nbsp;times&nbsp;between&nbsp;Poisson&nbsp;distributed&nbsp;events&nbsp;are&nbsp;relevant.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Weisstein,&nbsp;Eric&nbsp;W.&nbsp;"Gamma&nbsp;Distribution."&nbsp;From&nbsp;MathWorld--A<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wolfram&nbsp;Web&nbsp;Resource.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://mathworld.wolfram.com/GammaDistribution.html">http://mathworld.wolfram.com/GammaDistribution.html</a><br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Gamma-distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Gamma-distribution">http://en.wikipedia.org/wiki/Gamma-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;shape,&nbsp;scale&nbsp;=&nbsp;2.,&nbsp;1.&nbsp;#&nbsp;mean&nbsp;and&nbsp;width<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-standard_gamma">standard_gamma</a>(shape,&nbsp;1000000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;import&nbsp;scipy.special&nbsp;as&nbsp;sps<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;bins**(shape-1)&nbsp;*&nbsp;((np.exp(-bins/scale))/&nbsp;\<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(sps.<a href="#-gamma">gamma</a>(shape)&nbsp;*&nbsp;scale**shape))<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;y,&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-standard_normal"><strong>standard_normal</strong></a>(...)</dt><dd><tt><a href="#-standard_normal">standard_normal</a>(size=None)<br>
&nbsp;<br>
Returns&nbsp;samples&nbsp;from&nbsp;a&nbsp;Standard&nbsp;Normal&nbsp;distribution&nbsp;(mean=0,&nbsp;stdev=1).<br>
&nbsp;<br>
Parameters<br>
----------<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;float&nbsp;or&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;samples.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-standard_normal">standard_normal</a>(8000)<br>
&gt;&gt;&gt;&nbsp;s<br>
<a href="#-array">array</a>([&nbsp;0.6888893&nbsp;,&nbsp;&nbsp;0.78096262,&nbsp;-0.89086505,&nbsp;...,&nbsp;&nbsp;0.49876311,&nbsp;#random<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-0.38672696,&nbsp;-0.4685006&nbsp;])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#random<br>
&gt;&gt;&gt;&nbsp;s.shape<br>
(8000,)<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-standard_normal">standard_normal</a>(size=(3,&nbsp;4,&nbsp;2))<br>
&gt;&gt;&gt;&nbsp;s.shape<br>
(3,&nbsp;4,&nbsp;2)</tt></dd></dl>
 <dl><dt><a name="-standard_t"><strong>standard_t</strong></a>(...)</dt><dd><tt><a href="#-standard_t">standard_t</a>(df,&nbsp;size=None)<br>
&nbsp;<br>
Standard&nbsp;Student's&nbsp;t&nbsp;distribution&nbsp;with&nbsp;df&nbsp;degrees&nbsp;of&nbsp;freedom.<br>
&nbsp;<br>
A&nbsp;special&nbsp;case&nbsp;of&nbsp;the&nbsp;hyperbolic&nbsp;distribution.<br>
As&nbsp;`df`&nbsp;gets&nbsp;large,&nbsp;the&nbsp;result&nbsp;resembles&nbsp;that&nbsp;of&nbsp;the&nbsp;standard&nbsp;normal<br>
distribution&nbsp;(`standard_normal`).<br>
&nbsp;<br>
Parameters<br>
----------<br>
df&nbsp;:&nbsp;int<br>
&nbsp;&nbsp;&nbsp;&nbsp;Degrees&nbsp;of&nbsp;freedom,&nbsp;should&nbsp;be&nbsp;&gt;&nbsp;0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;samples.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;t&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x,&nbsp;df)&nbsp;=&nbsp;\frac{\Gamma(\frac{df+1}{2})}{\sqrt{\pi&nbsp;df}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\Gamma(\frac{df}{2})}\Bigl(&nbsp;1+\frac{x^2}{df}&nbsp;\Bigr)^{-(df+1)/2}<br>
&nbsp;<br>
The&nbsp;t&nbsp;test&nbsp;is&nbsp;based&nbsp;on&nbsp;an&nbsp;assumption&nbsp;that&nbsp;the&nbsp;data&nbsp;come&nbsp;from&nbsp;a&nbsp;Normal<br>
distribution.&nbsp;The&nbsp;t&nbsp;test&nbsp;provides&nbsp;a&nbsp;way&nbsp;to&nbsp;test&nbsp;whether&nbsp;the&nbsp;sample&nbsp;mean<br>
(that&nbsp;is&nbsp;the&nbsp;mean&nbsp;calculated&nbsp;from&nbsp;the&nbsp;data)&nbsp;is&nbsp;a&nbsp;good&nbsp;estimate&nbsp;of&nbsp;the&nbsp;true<br>
mean.<br>
&nbsp;<br>
The&nbsp;derivation&nbsp;of&nbsp;the&nbsp;t-distribution&nbsp;was&nbsp;forst&nbsp;published&nbsp;in&nbsp;1908&nbsp;by&nbsp;William<br>
Gisset&nbsp;while&nbsp;working&nbsp;for&nbsp;the&nbsp;Guinness&nbsp;Brewery&nbsp;in&nbsp;Dublin.&nbsp;Due&nbsp;to&nbsp;proprietary<br>
issues,&nbsp;he&nbsp;had&nbsp;to&nbsp;publish&nbsp;under&nbsp;a&nbsp;pseudonym,&nbsp;and&nbsp;so&nbsp;he&nbsp;used&nbsp;the&nbsp;name<br>
Student.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Dalgaard,&nbsp;Peter,&nbsp;"Introductory&nbsp;Statistics&nbsp;With&nbsp;R",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Springer,&nbsp;2002.<br>
..&nbsp;[2]&nbsp;Wikipedia,&nbsp;"Student's&nbsp;t-distribution"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Student's_t-distribution">http://en.wikipedia.org/wiki/Student's_t-distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
From&nbsp;Dalgaard&nbsp;page&nbsp;83&nbsp;[1]_,&nbsp;suppose&nbsp;the&nbsp;daily&nbsp;energy&nbsp;intake&nbsp;for&nbsp;11<br>
women&nbsp;in&nbsp;Kj&nbsp;is:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;intake&nbsp;=&nbsp;np.<a href="#-array">array</a>([5260.,&nbsp;5470,&nbsp;5640,&nbsp;6180,&nbsp;6390,&nbsp;6515,&nbsp;6805,&nbsp;7515,&nbsp;\<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7515,&nbsp;8230,&nbsp;8770])<br>
&nbsp;<br>
Does&nbsp;their&nbsp;energy&nbsp;intake&nbsp;deviate&nbsp;systematically&nbsp;from&nbsp;the&nbsp;recommended<br>
value&nbsp;of&nbsp;7725&nbsp;kJ?<br>
&nbsp;<br>
We&nbsp;have&nbsp;10&nbsp;degrees&nbsp;of&nbsp;freedom,&nbsp;so&nbsp;is&nbsp;the&nbsp;sample&nbsp;mean&nbsp;within&nbsp;95%&nbsp;of&nbsp;the<br>
recommended&nbsp;value?<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-standard_t">standard_t</a>(10,&nbsp;size=100000)<br>
&gt;&gt;&gt;&nbsp;np.mean(intake)<br>
6753.636363636364<br>
&gt;&gt;&gt;&nbsp;intake.std(ddof=1)<br>
1142.1232221373727<br>
&nbsp;<br>
Calculate&nbsp;the&nbsp;t&nbsp;statistic,&nbsp;setting&nbsp;the&nbsp;ddof&nbsp;parameter&nbsp;to&nbsp;the&nbsp;unbiased<br>
value&nbsp;so&nbsp;the&nbsp;divisor&nbsp;in&nbsp;the&nbsp;standard&nbsp;deviation&nbsp;will&nbsp;be&nbsp;degrees&nbsp;of<br>
freedom,&nbsp;N-1.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;t&nbsp;=&nbsp;(np.mean(intake)-7725)/(intake.std(ddof=1)/np.sqrt(len(intake)))<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;h&nbsp;=&nbsp;plt.hist(s,&nbsp;bins=100,&nbsp;normed=True)<br>
&nbsp;<br>
For&nbsp;a&nbsp;one-sided&nbsp;t-test,&nbsp;how&nbsp;far&nbsp;out&nbsp;in&nbsp;the&nbsp;distribution&nbsp;does&nbsp;the&nbsp;t<br>
statistic&nbsp;appear?<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;&gt;&gt;&gt;&nbsp;np.sum(s&lt;t)&nbsp;/&nbsp;float(len(s))<br>
0.0090699999999999999&nbsp;&nbsp;#random<br>
&nbsp;<br>
So&nbsp;the&nbsp;p-value&nbsp;is&nbsp;about&nbsp;0.009,&nbsp;which&nbsp;says&nbsp;the&nbsp;null&nbsp;hypothesis&nbsp;has&nbsp;a<br>
probability&nbsp;of&nbsp;about&nbsp;99%&nbsp;of&nbsp;being&nbsp;true.</tt></dd></dl>
 <dl><dt><a name="-triangular"><strong>triangular</strong></a>(...)</dt><dd><tt><a href="#-triangular">triangular</a>(left,&nbsp;mode,&nbsp;right,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;triangular&nbsp;distribution.<br>
&nbsp;<br>
The&nbsp;triangular&nbsp;distribution&nbsp;is&nbsp;a&nbsp;continuous&nbsp;probability&nbsp;distribution&nbsp;with<br>
lower&nbsp;limit&nbsp;left,&nbsp;peak&nbsp;at&nbsp;mode,&nbsp;and&nbsp;upper&nbsp;limit&nbsp;right.&nbsp;Unlike&nbsp;the&nbsp;other<br>
distributions,&nbsp;these&nbsp;parameters&nbsp;directly&nbsp;define&nbsp;the&nbsp;shape&nbsp;of&nbsp;the&nbsp;pdf.<br>
&nbsp;<br>
Parameters<br>
----------<br>
left&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Lower&nbsp;limit.<br>
mode&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;value&nbsp;where&nbsp;the&nbsp;peak&nbsp;of&nbsp;the&nbsp;distribution&nbsp;occurs.<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;value&nbsp;should&nbsp;fulfill&nbsp;the&nbsp;condition&nbsp;``left&nbsp;&lt;=&nbsp;mode&nbsp;&lt;=&nbsp;right``.<br>
right&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Upper&nbsp;limit,&nbsp;should&nbsp;be&nbsp;larger&nbsp;than&nbsp;`left`.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;returned&nbsp;samples&nbsp;all&nbsp;lie&nbsp;in&nbsp;the&nbsp;interval&nbsp;[left,&nbsp;right].<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;Triangular&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x;l,&nbsp;m,&nbsp;r)&nbsp;=&nbsp;\begin{cases}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\frac{2(x-l)}{(r-l)(m-l)}&amp;&nbsp;\text{for&nbsp;$l&nbsp;\leq&nbsp;x&nbsp;\leq&nbsp;m$},\\<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\frac{2(m-x)}{(r-l)(r-m)}&amp;&nbsp;\text{for&nbsp;$m&nbsp;\leq&nbsp;x&nbsp;\leq&nbsp;r$},\\<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&amp;&nbsp;\text{otherwise}.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\end{cases}<br>
&nbsp;<br>
The&nbsp;triangular&nbsp;distribution&nbsp;is&nbsp;often&nbsp;used&nbsp;in&nbsp;ill-defined&nbsp;problems&nbsp;where&nbsp;the<br>
underlying&nbsp;distribution&nbsp;is&nbsp;not&nbsp;known,&nbsp;but&nbsp;some&nbsp;knowledge&nbsp;of&nbsp;the&nbsp;limits&nbsp;and<br>
mode&nbsp;exists.&nbsp;Often&nbsp;it&nbsp;is&nbsp;used&nbsp;in&nbsp;simulations.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Wikipedia,&nbsp;"Triangular&nbsp;distribution"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Triangular_distribution">http://en.wikipedia.org/wiki/Triangular_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;values&nbsp;from&nbsp;the&nbsp;distribution&nbsp;and&nbsp;plot&nbsp;the&nbsp;histogram:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;h&nbsp;=&nbsp;plt.hist(np.random.<a href="#-triangular">triangular</a>(-3,&nbsp;0,&nbsp;8,&nbsp;100000),&nbsp;bins=200,<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-uniform"><strong>uniform</strong></a>(...)</dt><dd><tt><a href="#-uniform">uniform</a>(low=0.0,&nbsp;high=1.0,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;uniform&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;uniformly&nbsp;distributed&nbsp;over&nbsp;the&nbsp;half-open&nbsp;interval<br>
``[low,&nbsp;high)``&nbsp;(includes&nbsp;low,&nbsp;but&nbsp;excludes&nbsp;high).&nbsp;&nbsp;In&nbsp;other&nbsp;words,<br>
any&nbsp;value&nbsp;within&nbsp;the&nbsp;given&nbsp;interval&nbsp;is&nbsp;equally&nbsp;likely&nbsp;to&nbsp;be&nbsp;drawn<br>
by&nbsp;`uniform`.<br>
&nbsp;<br>
Parameters<br>
----------<br>
low&nbsp;:&nbsp;float,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Lower&nbsp;boundary&nbsp;of&nbsp;the&nbsp;output&nbsp;interval.&nbsp;&nbsp;All&nbsp;values&nbsp;generated&nbsp;will&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;greater&nbsp;than&nbsp;or&nbsp;equal&nbsp;to&nbsp;low.&nbsp;&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;0.<br>
high&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Upper&nbsp;boundary&nbsp;of&nbsp;the&nbsp;output&nbsp;interval.&nbsp;&nbsp;All&nbsp;values&nbsp;generated&nbsp;will&nbsp;be<br>
&nbsp;&nbsp;&nbsp;&nbsp;less&nbsp;than&nbsp;high.&nbsp;&nbsp;The&nbsp;default&nbsp;value&nbsp;is&nbsp;1.0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;samples,&nbsp;with&nbsp;shape&nbsp;`size`.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
randint&nbsp;:&nbsp;Discrete&nbsp;uniform&nbsp;distribution,&nbsp;yielding&nbsp;integers.<br>
random_integers&nbsp;:&nbsp;Discrete&nbsp;uniform&nbsp;distribution&nbsp;over&nbsp;the&nbsp;closed<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interval&nbsp;``[low,&nbsp;high]``.<br>
random_sample&nbsp;:&nbsp;Floats&nbsp;uniformly&nbsp;distributed&nbsp;over&nbsp;``[0,&nbsp;1)``.<br>
random&nbsp;:&nbsp;Alias&nbsp;for&nbsp;`random_sample`.<br>
rand&nbsp;:&nbsp;Convenience&nbsp;function&nbsp;that&nbsp;accepts&nbsp;dimensions&nbsp;as&nbsp;input,&nbsp;e.g.,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;``<a href="#-rand">rand</a>(2,2)``&nbsp;would&nbsp;generate&nbsp;a&nbsp;2-by-2&nbsp;array&nbsp;of&nbsp;floats,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uniformly&nbsp;distributed&nbsp;over&nbsp;``[0,&nbsp;1)``.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;of&nbsp;the&nbsp;uniform&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{1}{b&nbsp;-&nbsp;a}<br>
&nbsp;<br>
anywhere&nbsp;within&nbsp;the&nbsp;interval&nbsp;``[a,&nbsp;b)``,&nbsp;and&nbsp;zero&nbsp;elsewhere.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-uniform">uniform</a>(-1,0,1000)<br>
&nbsp;<br>
All&nbsp;values&nbsp;are&nbsp;within&nbsp;the&nbsp;given&nbsp;interval:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.all(s&nbsp;&gt;=&nbsp;-1)<br>
True<br>
&gt;&gt;&gt;&nbsp;np.all(s&nbsp;&lt;&nbsp;0)<br>
True<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with&nbsp;the<br>
probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;15,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.plot(bins,&nbsp;np.ones_like(bins),&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-unpackbits"><strong>unpackbits</strong></a>(...)</dt><dd><tt><a href="#-unpackbits">unpackbits</a>(myarray,&nbsp;axis=None)<br>
&nbsp;<br>
Unpacks&nbsp;elements&nbsp;of&nbsp;a&nbsp;uint8&nbsp;array&nbsp;into&nbsp;a&nbsp;binary-valued&nbsp;output&nbsp;array.<br>
&nbsp;<br>
Each&nbsp;element&nbsp;of&nbsp;`myarray`&nbsp;represents&nbsp;a&nbsp;bit-field&nbsp;that&nbsp;should&nbsp;be&nbsp;unpacked<br>
into&nbsp;a&nbsp;binary-valued&nbsp;output&nbsp;array.&nbsp;The&nbsp;shape&nbsp;of&nbsp;the&nbsp;output&nbsp;array&nbsp;is&nbsp;either<br>
1-D&nbsp;(if&nbsp;`axis`&nbsp;is&nbsp;None)&nbsp;or&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;the&nbsp;input&nbsp;array&nbsp;with&nbsp;unpacking<br>
done&nbsp;along&nbsp;the&nbsp;axis&nbsp;specified.<br>
&nbsp;<br>
Parameters<br>
----------<br>
myarray&nbsp;:&nbsp;ndarray,&nbsp;uint8&nbsp;type<br>
&nbsp;&nbsp;&nbsp;Input&nbsp;array.<br>
axis&nbsp;:&nbsp;int,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;Unpacks&nbsp;along&nbsp;this&nbsp;axis.<br>
&nbsp;<br>
Returns<br>
-------<br>
unpacked&nbsp;:&nbsp;ndarray,&nbsp;uint8&nbsp;type<br>
&nbsp;&nbsp;&nbsp;The&nbsp;elements&nbsp;are&nbsp;binary-valued&nbsp;(0&nbsp;or&nbsp;1).<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
packbits&nbsp;:&nbsp;Packs&nbsp;the&nbsp;elements&nbsp;of&nbsp;a&nbsp;binary-valued&nbsp;array&nbsp;into&nbsp;bits&nbsp;in&nbsp;a&nbsp;uint8<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([[2],&nbsp;[7],&nbsp;[23]],&nbsp;dtype=np.uint8)<br>
&gt;&gt;&gt;&nbsp;a<br>
<a href="#-array">array</a>([[&nbsp;2],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;7],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[23]],&nbsp;dtype=uint8)<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-unpackbits">unpackbits</a>(a,&nbsp;axis=1)<br>
&gt;&gt;&gt;&nbsp;b<br>
<a href="#-array">array</a>([[0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;1,&nbsp;0],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;1,&nbsp;1,&nbsp;1],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[0,&nbsp;0,&nbsp;0,&nbsp;1,&nbsp;0,&nbsp;1,&nbsp;1,&nbsp;1]],&nbsp;dtype=uint8)</tt></dd></dl>
 <dl><dt><a name="-unravel_index"><strong>unravel_index</strong></a>(...)</dt><dd><tt><a href="#-unravel_index">unravel_index</a>(indices,&nbsp;dims,&nbsp;order='C')<br>
&nbsp;<br>
Converts&nbsp;a&nbsp;flat&nbsp;index&nbsp;or&nbsp;array&nbsp;of&nbsp;flat&nbsp;indices&nbsp;into&nbsp;a&nbsp;tuple<br>
of&nbsp;coordinate&nbsp;arrays.<br>
&nbsp;<br>
Parameters<br>
----------<br>
indices&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;An&nbsp;integer&nbsp;array&nbsp;whose&nbsp;elements&nbsp;are&nbsp;indices&nbsp;into&nbsp;the&nbsp;flattened<br>
&nbsp;&nbsp;&nbsp;&nbsp;version&nbsp;of&nbsp;an&nbsp;array&nbsp;of&nbsp;dimensions&nbsp;``dims``.&nbsp;Before&nbsp;version&nbsp;1.6.0,<br>
&nbsp;&nbsp;&nbsp;&nbsp;this&nbsp;function&nbsp;accepted&nbsp;just&nbsp;one&nbsp;index&nbsp;value.<br>
dims&nbsp;:&nbsp;tuple&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;shape&nbsp;of&nbsp;the&nbsp;array&nbsp;to&nbsp;use&nbsp;for&nbsp;unraveling&nbsp;``indices``.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;..&nbsp;versionadded::&nbsp;1.6.0<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;Determines&nbsp;whether&nbsp;the&nbsp;indices&nbsp;should&nbsp;be&nbsp;viewed&nbsp;as&nbsp;indexing&nbsp;in<br>
&nbsp;&nbsp;&nbsp;&nbsp;C&nbsp;(row-major)&nbsp;order&nbsp;or&nbsp;FORTRAN&nbsp;(column-major)&nbsp;order.<br>
&nbsp;<br>
Returns<br>
-------<br>
unraveled_coords&nbsp;:&nbsp;tuple&nbsp;of&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Each&nbsp;array&nbsp;in&nbsp;the&nbsp;tuple&nbsp;has&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;the&nbsp;``indices``<br>
&nbsp;&nbsp;&nbsp;&nbsp;array.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
ravel_multi_index<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-unravel_index">unravel_index</a>([22,&nbsp;41,&nbsp;37],&nbsp;(7,6))<br>
(<a href="#-array">array</a>([3,&nbsp;6,&nbsp;6]),&nbsp;<a href="#-array">array</a>([4,&nbsp;5,&nbsp;1]))<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-unravel_index">unravel_index</a>([31,&nbsp;41,&nbsp;13],&nbsp;(7,6),&nbsp;order='F')<br>
(<a href="#-array">array</a>([3,&nbsp;6,&nbsp;6]),&nbsp;<a href="#-array">array</a>([4,&nbsp;5,&nbsp;1]))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-unravel_index">unravel_index</a>(1621,&nbsp;(6,7,8,9))<br>
(3,&nbsp;1,&nbsp;4,&nbsp;1)</tt></dd></dl>
 <dl><dt><a name="-vdot"><strong>vdot</strong></a>(...)</dt><dd><tt><a href="#-vdot">vdot</a>(a,&nbsp;b)<br>
&nbsp;<br>
Return&nbsp;the&nbsp;dot&nbsp;product&nbsp;of&nbsp;two&nbsp;vectors.<br>
&nbsp;<br>
The&nbsp;<a href="#-vdot">vdot</a>(`a`,&nbsp;`b`)&nbsp;function&nbsp;handles&nbsp;complex&nbsp;numbers&nbsp;differently&nbsp;than<br>
<a href="#-dot">dot</a>(`a`,&nbsp;`b`).&nbsp;&nbsp;If&nbsp;the&nbsp;first&nbsp;argument&nbsp;is&nbsp;complex&nbsp;the&nbsp;complex&nbsp;conjugate<br>
of&nbsp;the&nbsp;first&nbsp;argument&nbsp;is&nbsp;used&nbsp;for&nbsp;the&nbsp;calculation&nbsp;of&nbsp;the&nbsp;dot&nbsp;product.<br>
&nbsp;<br>
Note&nbsp;that&nbsp;`vdot`&nbsp;handles&nbsp;multidimensional&nbsp;arrays&nbsp;differently&nbsp;than&nbsp;`dot`:<br>
it&nbsp;does&nbsp;*not*&nbsp;perform&nbsp;a&nbsp;matrix&nbsp;product,&nbsp;but&nbsp;flattens&nbsp;input&nbsp;arguments<br>
to&nbsp;1-D&nbsp;vectors&nbsp;first.&nbsp;Consequently,&nbsp;it&nbsp;should&nbsp;only&nbsp;be&nbsp;used&nbsp;for&nbsp;vectors.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`a`&nbsp;is&nbsp;complex&nbsp;the&nbsp;complex&nbsp;conjugate&nbsp;is&nbsp;taken&nbsp;before&nbsp;calculation<br>
&nbsp;&nbsp;&nbsp;&nbsp;of&nbsp;the&nbsp;dot&nbsp;product.<br>
b&nbsp;:&nbsp;array_like<br>
&nbsp;&nbsp;&nbsp;&nbsp;Second&nbsp;argument&nbsp;to&nbsp;the&nbsp;dot&nbsp;product.<br>
&nbsp;<br>
Returns<br>
-------<br>
output&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Dot&nbsp;product&nbsp;of&nbsp;`a`&nbsp;and&nbsp;`b`.&nbsp;&nbsp;Can&nbsp;be&nbsp;an&nbsp;int,&nbsp;float,&nbsp;or<br>
&nbsp;&nbsp;&nbsp;&nbsp;complex&nbsp;depending&nbsp;on&nbsp;the&nbsp;types&nbsp;of&nbsp;`a`&nbsp;and&nbsp;`b`.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
dot&nbsp;:&nbsp;Return&nbsp;the&nbsp;dot&nbsp;product&nbsp;without&nbsp;using&nbsp;the&nbsp;complex&nbsp;conjugate&nbsp;of&nbsp;the<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;first&nbsp;argument.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([1+2j,3+4j])<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-array">array</a>([5+6j,7+8j])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-vdot">vdot</a>(a,&nbsp;b)<br>
(70-8j)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-vdot">vdot</a>(b,&nbsp;a)<br>
(70+8j)<br>
&nbsp;<br>
Note&nbsp;that&nbsp;higher-dimensional&nbsp;arrays&nbsp;are&nbsp;flattened!<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.<a href="#-array">array</a>([[1,&nbsp;4],&nbsp;[5,&nbsp;6]])<br>
&gt;&gt;&gt;&nbsp;b&nbsp;=&nbsp;np.<a href="#-array">array</a>([[4,&nbsp;1],&nbsp;[2,&nbsp;2]])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-vdot">vdot</a>(a,&nbsp;b)<br>
30<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-vdot">vdot</a>(b,&nbsp;a)<br>
30<br>
&gt;&gt;&gt;&nbsp;1*4&nbsp;+&nbsp;4*1&nbsp;+&nbsp;5*2&nbsp;+&nbsp;6*2<br>
30</tt></dd></dl>
 <dl><dt><a name="-vonmises"><strong>vonmises</strong></a>(...)</dt><dd><tt><a href="#-vonmises">vonmises</a>(mu,&nbsp;kappa,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;von&nbsp;Mises&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;von&nbsp;Mises&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;mode<br>
(mu)&nbsp;and&nbsp;dispersion&nbsp;(kappa),&nbsp;on&nbsp;the&nbsp;interval&nbsp;[-pi,&nbsp;pi].<br>
&nbsp;<br>
The&nbsp;von&nbsp;Mises&nbsp;distribution&nbsp;(also&nbsp;known&nbsp;as&nbsp;the&nbsp;circular&nbsp;normal<br>
distribution)&nbsp;is&nbsp;a&nbsp;continuous&nbsp;probability&nbsp;distribution&nbsp;on&nbsp;the&nbsp;unit<br>
circle.&nbsp;&nbsp;It&nbsp;may&nbsp;be&nbsp;thought&nbsp;of&nbsp;as&nbsp;the&nbsp;circular&nbsp;analogue&nbsp;of&nbsp;the&nbsp;normal<br>
distribution.<br>
&nbsp;<br>
Parameters<br>
----------<br>
mu&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Mode&nbsp;("center")&nbsp;of&nbsp;the&nbsp;distribution.<br>
kappa&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Dispersion&nbsp;of&nbsp;the&nbsp;distribution,&nbsp;has&nbsp;to&nbsp;be&nbsp;&gt;=0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;scalar&nbsp;or&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;returned&nbsp;samples,&nbsp;which&nbsp;are&nbsp;in&nbsp;the&nbsp;interval&nbsp;[-pi,&nbsp;pi].<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.vonmises&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution,&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;von&nbsp;Mises&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{e^{\kappa&nbsp;cos(x-\mu)}}{2\pi&nbsp;I_0(\kappa)},<br>
&nbsp;<br>
where&nbsp;:math:`\mu`&nbsp;is&nbsp;the&nbsp;mode&nbsp;and&nbsp;:math:`\kappa`&nbsp;the&nbsp;dispersion,<br>
and&nbsp;:math:`I_0(\kappa)`&nbsp;is&nbsp;the&nbsp;modified&nbsp;Bessel&nbsp;function&nbsp;of&nbsp;order&nbsp;0.<br>
&nbsp;<br>
The&nbsp;von&nbsp;Mises&nbsp;is&nbsp;named&nbsp;for&nbsp;Richard&nbsp;Edler&nbsp;von&nbsp;Mises,&nbsp;who&nbsp;was&nbsp;born&nbsp;in<br>
Austria-Hungary,&nbsp;in&nbsp;what&nbsp;is&nbsp;now&nbsp;the&nbsp;Ukraine.&nbsp;&nbsp;He&nbsp;fled&nbsp;to&nbsp;the&nbsp;United<br>
States&nbsp;in&nbsp;1939&nbsp;and&nbsp;became&nbsp;a&nbsp;professor&nbsp;at&nbsp;Harvard.&nbsp;&nbsp;He&nbsp;worked&nbsp;in<br>
probability&nbsp;theory,&nbsp;aerodynamics,&nbsp;fluid&nbsp;mechanics,&nbsp;and&nbsp;philosophy&nbsp;of<br>
science.<br>
&nbsp;<br>
References<br>
----------<br>
Abramowitz,&nbsp;M.&nbsp;and&nbsp;Stegun,&nbsp;I.&nbsp;A.&nbsp;(ed.),&nbsp;*Handbook&nbsp;of&nbsp;Mathematical<br>
Functions*,&nbsp;New&nbsp;York:&nbsp;Dover,&nbsp;1965.<br>
&nbsp;<br>
von&nbsp;Mises,&nbsp;R.,&nbsp;*Mathematical&nbsp;Theory&nbsp;of&nbsp;Probability&nbsp;and&nbsp;Statistics*,<br>
New&nbsp;York:&nbsp;Academic&nbsp;Press,&nbsp;1964.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;mu,&nbsp;kappa&nbsp;=&nbsp;0.0,&nbsp;4.0&nbsp;#&nbsp;mean&nbsp;and&nbsp;dispersion<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-vonmises">vonmises</a>(mu,&nbsp;kappa,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;import&nbsp;scipy.special&nbsp;as&nbsp;sps<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s,&nbsp;50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(-np.pi,&nbsp;np.pi,&nbsp;2*np.pi/50.)<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;-np.exp(kappa*np.cos(x-mu))/(2*np.pi*sps.jn(0,kappa))<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;y/max(y),&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-wald"><strong>wald</strong></a>(...)</dt><dd><tt><a href="#-wald">wald</a>(mean,&nbsp;scale,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Wald,&nbsp;or&nbsp;Inverse&nbsp;Gaussian,&nbsp;distribution.<br>
&nbsp;<br>
As&nbsp;the&nbsp;scale&nbsp;approaches&nbsp;infinity,&nbsp;the&nbsp;distribution&nbsp;becomes&nbsp;more&nbsp;like&nbsp;a<br>
Gaussian.<br>
&nbsp;<br>
Some&nbsp;references&nbsp;claim&nbsp;that&nbsp;the&nbsp;Wald&nbsp;is&nbsp;an&nbsp;Inverse&nbsp;Gaussian&nbsp;with&nbsp;mean=1,&nbsp;but<br>
this&nbsp;is&nbsp;by&nbsp;no&nbsp;means&nbsp;universal.<br>
&nbsp;<br>
The&nbsp;Inverse&nbsp;Gaussian&nbsp;distribution&nbsp;was&nbsp;first&nbsp;studied&nbsp;in&nbsp;relationship&nbsp;to<br>
Brownian&nbsp;motion.&nbsp;In&nbsp;1956&nbsp;M.C.K.&nbsp;Tweedie&nbsp;used&nbsp;the&nbsp;name&nbsp;Inverse&nbsp;Gaussian<br>
because&nbsp;there&nbsp;is&nbsp;an&nbsp;inverse&nbsp;relationship&nbsp;between&nbsp;the&nbsp;time&nbsp;to&nbsp;cover&nbsp;a&nbsp;unit<br>
distance&nbsp;and&nbsp;distance&nbsp;covered&nbsp;in&nbsp;unit&nbsp;time.<br>
&nbsp;<br>
Parameters<br>
----------<br>
mean&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Distribution&nbsp;mean,&nbsp;should&nbsp;be&nbsp;&gt;&nbsp;0.<br>
scale&nbsp;:&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Scale&nbsp;parameter,&nbsp;should&nbsp;be&nbsp;&gt;=&nbsp;0.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;scalar<br>
&nbsp;&nbsp;&nbsp;&nbsp;Drawn&nbsp;sample,&nbsp;all&nbsp;greater&nbsp;than&nbsp;zero.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;function&nbsp;for&nbsp;the&nbsp;Wald&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;P(x;mean,scale)&nbsp;=&nbsp;\sqrt{\frac{scale}{2\pi&nbsp;x^3}}e^<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\frac{-scale(x-mean)^2}{2\cdotp&nbsp;mean^2x}<br>
&nbsp;<br>
As&nbsp;noted&nbsp;above&nbsp;the&nbsp;Inverse&nbsp;Gaussian&nbsp;distribution&nbsp;first&nbsp;arise&nbsp;from&nbsp;attempts<br>
to&nbsp;model&nbsp;Brownian&nbsp;Motion.&nbsp;It&nbsp;is&nbsp;also&nbsp;a&nbsp;competitor&nbsp;to&nbsp;the&nbsp;Weibull&nbsp;for&nbsp;use&nbsp;in<br>
reliability&nbsp;modeling&nbsp;and&nbsp;modeling&nbsp;stock&nbsp;returns&nbsp;and&nbsp;interest&nbsp;rate<br>
processes.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Brighton&nbsp;Webs&nbsp;Ltd.,&nbsp;Wald&nbsp;Distribution,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.brighton-webs.co.uk/distributions/wald.asp">http://www.brighton-webs.co.uk/distributions/wald.asp</a><br>
..&nbsp;[2]&nbsp;Chhikara,&nbsp;Raj&nbsp;S.,&nbsp;and&nbsp;Folks,&nbsp;J.&nbsp;Leroy,&nbsp;"The&nbsp;Inverse&nbsp;Gaussian<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Distribution:&nbsp;Theory&nbsp;:&nbsp;Methodology,&nbsp;and&nbsp;Applications",&nbsp;CRC&nbsp;Press,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1988.<br>
..&nbsp;[3]&nbsp;Wikipedia,&nbsp;"Wald&nbsp;distribution"<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Wald_distribution">http://en.wikipedia.org/wiki/Wald_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;values&nbsp;from&nbsp;the&nbsp;distribution&nbsp;and&nbsp;plot&nbsp;the&nbsp;histogram:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;h&nbsp;=&nbsp;plt.hist(np.random.<a href="#-wald">wald</a>(3,&nbsp;2,&nbsp;100000),&nbsp;bins=200,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-weibull"><strong>weibull</strong></a>(...)</dt><dd><tt><a href="#-weibull">weibull</a>(a,&nbsp;size=None)<br>
&nbsp;<br>
Weibull&nbsp;distribution.<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;1-parameter&nbsp;Weibull&nbsp;distribution&nbsp;with&nbsp;the&nbsp;given<br>
shape&nbsp;parameter&nbsp;`a`.<br>
&nbsp;<br>
..&nbsp;math::&nbsp;X&nbsp;=&nbsp;(-ln(U))^{1/a}<br>
&nbsp;<br>
Here,&nbsp;U&nbsp;is&nbsp;drawn&nbsp;from&nbsp;the&nbsp;uniform&nbsp;distribution&nbsp;over&nbsp;(0,1].<br>
&nbsp;<br>
The&nbsp;more&nbsp;common&nbsp;2-parameter&nbsp;Weibull,&nbsp;including&nbsp;a&nbsp;scale&nbsp;parameter<br>
:math:`\lambda`&nbsp;is&nbsp;just&nbsp;:math:`X&nbsp;=&nbsp;\lambda(-ln(U))^{1/a}`.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;float<br>
&nbsp;&nbsp;&nbsp;&nbsp;Shape&nbsp;of&nbsp;the&nbsp;distribution.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.weibull_max<br>
scipy.stats.distributions.weibull_min<br>
scipy.stats.distributions.genextreme<br>
gumbel<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;Weibull&nbsp;(or&nbsp;Type&nbsp;III&nbsp;asymptotic&nbsp;extreme&nbsp;value&nbsp;distribution&nbsp;for&nbsp;smallest<br>
values,&nbsp;SEV&nbsp;Type&nbsp;III,&nbsp;or&nbsp;Rosin-Rammler&nbsp;distribution)&nbsp;is&nbsp;one&nbsp;of&nbsp;a&nbsp;class&nbsp;of<br>
Generalized&nbsp;Extreme&nbsp;Value&nbsp;(GEV)&nbsp;distributions&nbsp;used&nbsp;in&nbsp;modeling&nbsp;extreme<br>
value&nbsp;problems.&nbsp;&nbsp;This&nbsp;class&nbsp;includes&nbsp;the&nbsp;Gumbel&nbsp;and&nbsp;Frechet&nbsp;distributions.<br>
&nbsp;<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Weibull&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{a}<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{\lambda}(\frac{x}{\lambda})^{a-1}e^{-(x/\lambda)^a},<br>
&nbsp;<br>
where&nbsp;:math:`a`&nbsp;is&nbsp;the&nbsp;shape&nbsp;and&nbsp;:math:`\lambda`&nbsp;the&nbsp;scale.<br>
&nbsp;<br>
The&nbsp;function&nbsp;has&nbsp;its&nbsp;peak&nbsp;(the&nbsp;mode)&nbsp;at<br>
:math:`\lambda(\frac{a-1}{a})^{1/a}`.<br>
&nbsp;<br>
When&nbsp;``a&nbsp;=&nbsp;1``,&nbsp;the&nbsp;Weibull&nbsp;distribution&nbsp;reduces&nbsp;to&nbsp;the&nbsp;exponential<br>
distribution.<br>
&nbsp;<br>
References<br>
----------<br>
..&nbsp;[1]&nbsp;Waloddi&nbsp;Weibull,&nbsp;Professor,&nbsp;Royal&nbsp;Technical&nbsp;University,&nbsp;Stockholm,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1939&nbsp;"A&nbsp;Statistical&nbsp;Theory&nbsp;Of&nbsp;The&nbsp;Strength&nbsp;Of&nbsp;Materials",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ingeniorsvetenskapsakademiens&nbsp;Handlingar&nbsp;Nr&nbsp;151,&nbsp;1939,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Generalstabens&nbsp;Litografiska&nbsp;Anstalts&nbsp;Forlag,&nbsp;Stockholm.<br>
..&nbsp;[2]&nbsp;Waloddi&nbsp;Weibull,&nbsp;1951&nbsp;"A&nbsp;Statistical&nbsp;Distribution&nbsp;Function&nbsp;of&nbsp;Wide<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Applicability",&nbsp;&nbsp;Journal&nbsp;Of&nbsp;Applied&nbsp;Mechanics&nbsp;ASME&nbsp;Paper.<br>
..&nbsp;[3]&nbsp;Wikipedia,&nbsp;"Weibull&nbsp;distribution",<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://en.wikipedia.org/wiki/Weibull_distribution">http://en.wikipedia.org/wiki/Weibull_distribution</a><br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;5.&nbsp;#&nbsp;shape<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-weibull">weibull</a>(a,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(1,100.)/50.<br>
&gt;&gt;&gt;&nbsp;def&nbsp;weib(x,n,a):<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;(a&nbsp;/&nbsp;n)&nbsp;*&nbsp;(x&nbsp;/&nbsp;n)**(a&nbsp;-&nbsp;1)&nbsp;*&nbsp;np.exp(-(x&nbsp;/&nbsp;n)**a)<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(np.random.<a href="#-weibull">weibull</a>(5.,1000))<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(1,100.)/50.<br>
&gt;&gt;&gt;&nbsp;scale&nbsp;=&nbsp;count.max()/weib(x,&nbsp;1.,&nbsp;5.).max()<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;weib(x,&nbsp;1.,&nbsp;5.)*scale)<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
 <dl><dt><a name="-where"><strong>where</strong></a>(...)</dt><dd><tt><a href="#-where">where</a>(condition,&nbsp;[x,&nbsp;y])<br>
&nbsp;<br>
Return&nbsp;elements,&nbsp;either&nbsp;from&nbsp;`x`&nbsp;or&nbsp;`y`,&nbsp;depending&nbsp;on&nbsp;`condition`.<br>
&nbsp;<br>
If&nbsp;only&nbsp;`condition`&nbsp;is&nbsp;given,&nbsp;return&nbsp;``condition.nonzero()``.<br>
&nbsp;<br>
Parameters<br>
----------<br>
condition&nbsp;:&nbsp;array_like,&nbsp;bool<br>
&nbsp;&nbsp;&nbsp;&nbsp;When&nbsp;True,&nbsp;yield&nbsp;`x`,&nbsp;otherwise&nbsp;yield&nbsp;`y`.<br>
x,&nbsp;y&nbsp;:&nbsp;array_like,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Values&nbsp;from&nbsp;which&nbsp;to&nbsp;choose.&nbsp;`x`&nbsp;and&nbsp;`y`&nbsp;need&nbsp;to&nbsp;have&nbsp;the&nbsp;same<br>
&nbsp;&nbsp;&nbsp;&nbsp;shape&nbsp;as&nbsp;`condition`.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ndarrays<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;both&nbsp;`x`&nbsp;and&nbsp;`y`&nbsp;are&nbsp;specified,&nbsp;the&nbsp;output&nbsp;array&nbsp;contains<br>
&nbsp;&nbsp;&nbsp;&nbsp;elements&nbsp;of&nbsp;`x`&nbsp;where&nbsp;`condition`&nbsp;is&nbsp;True,&nbsp;and&nbsp;elements&nbsp;from<br>
&nbsp;&nbsp;&nbsp;&nbsp;`y`&nbsp;elsewhere.<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;only&nbsp;`condition`&nbsp;is&nbsp;given,&nbsp;return&nbsp;the&nbsp;tuple<br>
&nbsp;&nbsp;&nbsp;&nbsp;``condition.nonzero()``,&nbsp;the&nbsp;indices&nbsp;where&nbsp;`condition`&nbsp;is&nbsp;True.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
nonzero,&nbsp;choose<br>
&nbsp;<br>
Notes<br>
-----<br>
If&nbsp;`x`&nbsp;and&nbsp;`y`&nbsp;are&nbsp;given&nbsp;and&nbsp;input&nbsp;arrays&nbsp;are&nbsp;1-D,&nbsp;`where`&nbsp;is<br>
equivalent&nbsp;to::<br>
&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;[xv&nbsp;if&nbsp;c&nbsp;else&nbsp;yv&nbsp;for&nbsp;(c,xv,yv)&nbsp;in&nbsp;zip(condition,x,y)]<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-where">where</a>([[True,&nbsp;False],&nbsp;[True,&nbsp;True]],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[1,&nbsp;2],&nbsp;[3,&nbsp;4]],<br>
...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[9,&nbsp;8],&nbsp;[7,&nbsp;6]])<br>
<a href="#-array">array</a>([[1,&nbsp;8],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[3,&nbsp;4]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-where">where</a>([[0,&nbsp;1],&nbsp;[1,&nbsp;0]])<br>
(<a href="#-array">array</a>([0,&nbsp;1]),&nbsp;<a href="#-array">array</a>([1,&nbsp;0]))<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(9.).reshape(3,&nbsp;3)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-where">where</a>(&nbsp;x&nbsp;&gt;&nbsp;5&nbsp;)<br>
(<a href="#-array">array</a>([2,&nbsp;2,&nbsp;2]),&nbsp;<a href="#-array">array</a>([0,&nbsp;1,&nbsp;2]))<br>
&gt;&gt;&gt;&nbsp;x[np.<a href="#-where">where</a>(&nbsp;x&nbsp;&gt;&nbsp;3.0&nbsp;)]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Note:&nbsp;result&nbsp;is&nbsp;1D.<br>
<a href="#-array">array</a>([&nbsp;4.,&nbsp;&nbsp;5.,&nbsp;&nbsp;6.,&nbsp;&nbsp;7.,&nbsp;&nbsp;8.])<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-where">where</a>(x&nbsp;&lt;&nbsp;5,&nbsp;x,&nbsp;-1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Note:&nbsp;broadcasting.<br>
<a href="#-array">array</a>([[&nbsp;0.,&nbsp;&nbsp;1.,&nbsp;&nbsp;2.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;3.,&nbsp;&nbsp;4.,&nbsp;-1.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[-1.,&nbsp;-1.,&nbsp;-1.]])<br>
&nbsp;<br>
Find&nbsp;the&nbsp;indices&nbsp;of&nbsp;elements&nbsp;of&nbsp;`x`&nbsp;that&nbsp;are&nbsp;in&nbsp;`goodvalues`.<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;goodvalues&nbsp;=&nbsp;[3,&nbsp;4,&nbsp;7]<br>
&gt;&gt;&gt;&nbsp;ix&nbsp;=&nbsp;np.in1d(x.ravel(),&nbsp;goodvalues).reshape(x.shape)<br>
&gt;&gt;&gt;&nbsp;ix<br>
<a href="#-array">array</a>([[False,&nbsp;False,&nbsp;False],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;True,&nbsp;&nbsp;True,&nbsp;False],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[False,&nbsp;&nbsp;True,&nbsp;False]],&nbsp;dtype=bool)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-where">where</a>(ix)<br>
(<a href="#-array">array</a>([1,&nbsp;1,&nbsp;2]),&nbsp;<a href="#-array">array</a>([0,&nbsp;1,&nbsp;1]))</tt></dd></dl>
 <dl><dt><a name="-zeros"><strong>zeros</strong></a>(...)</dt><dd><tt><a href="#-zeros">zeros</a>(shape,&nbsp;dtype=float,&nbsp;order='C')<br>
&nbsp;<br>
Return&nbsp;a&nbsp;new&nbsp;array&nbsp;of&nbsp;given&nbsp;shape&nbsp;and&nbsp;type,&nbsp;filled&nbsp;with&nbsp;zeros.<br>
&nbsp;<br>
Parameters<br>
----------<br>
shape&nbsp;:&nbsp;int&nbsp;or&nbsp;sequence&nbsp;of&nbsp;ints<br>
&nbsp;&nbsp;&nbsp;&nbsp;Shape&nbsp;of&nbsp;the&nbsp;new&nbsp;array,&nbsp;e.g.,&nbsp;``(2,&nbsp;3)``&nbsp;or&nbsp;``2``.<br>
dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;desired&nbsp;data-type&nbsp;for&nbsp;the&nbsp;array,&nbsp;e.g.,&nbsp;`numpy.int8`.&nbsp;&nbsp;Default&nbsp;is<br>
&nbsp;&nbsp;&nbsp;&nbsp;`numpy.float64`.<br>
order&nbsp;:&nbsp;{'C',&nbsp;'F'},&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Whether&nbsp;to&nbsp;store&nbsp;multidimensional&nbsp;data&nbsp;in&nbsp;C-&nbsp;or&nbsp;Fortran-contiguous<br>
&nbsp;&nbsp;&nbsp;&nbsp;(row-&nbsp;or&nbsp;column-wise)&nbsp;order&nbsp;in&nbsp;memory.<br>
&nbsp;<br>
Returns<br>
-------<br>
out&nbsp;:&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;of&nbsp;zeros&nbsp;with&nbsp;the&nbsp;given&nbsp;shape,&nbsp;dtype,&nbsp;and&nbsp;order.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
zeros_like&nbsp;:&nbsp;Return&nbsp;an&nbsp;array&nbsp;of&nbsp;zeros&nbsp;with&nbsp;shape&nbsp;and&nbsp;type&nbsp;of&nbsp;input.<br>
ones_like&nbsp;:&nbsp;Return&nbsp;an&nbsp;array&nbsp;of&nbsp;ones&nbsp;with&nbsp;shape&nbsp;and&nbsp;type&nbsp;of&nbsp;input.<br>
empty_like&nbsp;:&nbsp;Return&nbsp;an&nbsp;empty&nbsp;array&nbsp;with&nbsp;shape&nbsp;and&nbsp;type&nbsp;of&nbsp;input.<br>
ones&nbsp;:&nbsp;Return&nbsp;a&nbsp;new&nbsp;array&nbsp;setting&nbsp;values&nbsp;to&nbsp;one.<br>
empty&nbsp;:&nbsp;Return&nbsp;a&nbsp;new&nbsp;uninitialized&nbsp;array.<br>
&nbsp;<br>
Examples<br>
--------<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-zeros">zeros</a>(5)<br>
<a href="#-array">array</a>([&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.,&nbsp;&nbsp;0.])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-zeros">zeros</a>((5,),&nbsp;dtype=numpy.int)<br>
<a href="#-array">array</a>([0,&nbsp;0,&nbsp;0,&nbsp;0,&nbsp;0])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-zeros">zeros</a>((2,&nbsp;1))<br>
<a href="#-array">array</a>([[&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;(2,2)<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-zeros">zeros</a>(s)<br>
<a href="#-array">array</a>([[&nbsp;0.,&nbsp;&nbsp;0.],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;0.,&nbsp;&nbsp;0.]])<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;np.<a href="#-zeros">zeros</a>((2,),&nbsp;dtype=[('x',&nbsp;'i4'),&nbsp;('y',&nbsp;'i4')])&nbsp;#&nbsp;custom&nbsp;dtype<br>
<a href="#-array">array</a>([(0,&nbsp;0),&nbsp;(0,&nbsp;0)],<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('x',&nbsp;'&lt;i4'),&nbsp;('y',&nbsp;'&lt;i4')])</tt></dd></dl>
 <dl><dt><a name="-zipf"><strong>zipf</strong></a>(...)</dt><dd><tt><a href="#-zipf">zipf</a>(a,&nbsp;size=None)<br>
&nbsp;<br>
Draw&nbsp;samples&nbsp;from&nbsp;a&nbsp;Zipf&nbsp;distribution.<br>
&nbsp;<br>
Samples&nbsp;are&nbsp;drawn&nbsp;from&nbsp;a&nbsp;Zipf&nbsp;distribution&nbsp;with&nbsp;specified&nbsp;parameter<br>
`a`&nbsp;&gt;&nbsp;1.<br>
&nbsp;<br>
The&nbsp;Zipf&nbsp;distribution&nbsp;(also&nbsp;known&nbsp;as&nbsp;the&nbsp;zeta&nbsp;distribution)&nbsp;is&nbsp;a<br>
continuous&nbsp;probability&nbsp;distribution&nbsp;that&nbsp;satisfies&nbsp;Zipf's&nbsp;law:&nbsp;the<br>
frequency&nbsp;of&nbsp;an&nbsp;item&nbsp;is&nbsp;inversely&nbsp;proportional&nbsp;to&nbsp;its&nbsp;rank&nbsp;in&nbsp;a<br>
frequency&nbsp;table.<br>
&nbsp;<br>
Parameters<br>
----------<br>
a&nbsp;:&nbsp;float&nbsp;&gt;&nbsp;1<br>
&nbsp;&nbsp;&nbsp;&nbsp;Distribution&nbsp;parameter.<br>
size&nbsp;:&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
&nbsp;&nbsp;&nbsp;&nbsp;Output&nbsp;shape.&nbsp;&nbsp;If&nbsp;the&nbsp;given&nbsp;shape&nbsp;is,&nbsp;e.g.,&nbsp;``(m,&nbsp;n,&nbsp;k)``,&nbsp;then<br>
&nbsp;&nbsp;&nbsp;&nbsp;``m&nbsp;*&nbsp;n&nbsp;*&nbsp;k``&nbsp;samples&nbsp;are&nbsp;drawn.&nbsp;&nbsp;Default&nbsp;is&nbsp;None,&nbsp;in&nbsp;which&nbsp;case&nbsp;a<br>
&nbsp;&nbsp;&nbsp;&nbsp;single&nbsp;value&nbsp;is&nbsp;returned.<br>
&nbsp;<br>
Returns<br>
-------<br>
samples&nbsp;:&nbsp;scalar&nbsp;or&nbsp;ndarray<br>
&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;returned&nbsp;samples&nbsp;are&nbsp;greater&nbsp;than&nbsp;or&nbsp;equal&nbsp;to&nbsp;one.<br>
&nbsp;<br>
See&nbsp;Also<br>
--------<br>
scipy.stats.distributions.zipf&nbsp;:&nbsp;probability&nbsp;density&nbsp;function,<br>
&nbsp;&nbsp;&nbsp;&nbsp;distribution,&nbsp;or&nbsp;cumulative&nbsp;density&nbsp;function,&nbsp;etc.<br>
&nbsp;<br>
Notes<br>
-----<br>
The&nbsp;probability&nbsp;density&nbsp;for&nbsp;the&nbsp;Zipf&nbsp;distribution&nbsp;is<br>
&nbsp;<br>
..&nbsp;math::&nbsp;p(x)&nbsp;=&nbsp;\frac{x^{-a}}{\zeta(a)},<br>
&nbsp;<br>
where&nbsp;:math:`\zeta`&nbsp;is&nbsp;the&nbsp;Riemann&nbsp;Zeta&nbsp;function.<br>
&nbsp;<br>
It&nbsp;is&nbsp;named&nbsp;for&nbsp;the&nbsp;American&nbsp;linguist&nbsp;George&nbsp;Kingsley&nbsp;Zipf,&nbsp;who&nbsp;noted<br>
that&nbsp;the&nbsp;frequency&nbsp;of&nbsp;any&nbsp;word&nbsp;in&nbsp;a&nbsp;sample&nbsp;of&nbsp;a&nbsp;language&nbsp;is&nbsp;inversely<br>
proportional&nbsp;to&nbsp;its&nbsp;rank&nbsp;in&nbsp;the&nbsp;frequency&nbsp;table.<br>
&nbsp;<br>
References<br>
----------<br>
Zipf,&nbsp;G.&nbsp;K.,&nbsp;*Selected&nbsp;Studies&nbsp;of&nbsp;the&nbsp;Principle&nbsp;of&nbsp;Relative&nbsp;Frequency<br>
in&nbsp;Language*,&nbsp;Cambridge,&nbsp;MA:&nbsp;Harvard&nbsp;Univ.&nbsp;Press,&nbsp;1932.<br>
&nbsp;<br>
Examples<br>
--------<br>
Draw&nbsp;samples&nbsp;from&nbsp;the&nbsp;distribution:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;2.&nbsp;#&nbsp;parameter<br>
&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;np.random.<a href="#-zipf">zipf</a>(a,&nbsp;1000)<br>
&nbsp;<br>
Display&nbsp;the&nbsp;histogram&nbsp;of&nbsp;the&nbsp;samples,&nbsp;along&nbsp;with<br>
the&nbsp;probability&nbsp;density&nbsp;function:<br>
&nbsp;<br>
&gt;&gt;&gt;&nbsp;import&nbsp;matplotlib.pyplot&nbsp;as&nbsp;plt<br>
&gt;&gt;&gt;&nbsp;import&nbsp;scipy.special&nbsp;as&nbsp;sps<br>
Truncate&nbsp;s&nbsp;values&nbsp;at&nbsp;50&nbsp;so&nbsp;plot&nbsp;is&nbsp;interesting<br>
&gt;&gt;&gt;&nbsp;count,&nbsp;bins,&nbsp;ignored&nbsp;=&nbsp;plt.hist(s[s&lt;50],&nbsp;50,&nbsp;normed=True)<br>
&gt;&gt;&gt;&nbsp;x&nbsp;=&nbsp;np.<a href="#-arange">arange</a>(1.,&nbsp;50.)<br>
&gt;&gt;&gt;&nbsp;y&nbsp;=&nbsp;x**(-a)/sps.zetac(a)<br>
&gt;&gt;&gt;&nbsp;plt.plot(x,&nbsp;y/max(y),&nbsp;linewidth=2,&nbsp;color='r')<br>
&gt;&gt;&gt;&nbsp;plt.show()</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
    
<tr><td bgcolor="#55aa55"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"><strong>A4</strong> = (595.275590551181, 841.8897637795275)<br>
<strong>ACTIVE</strong> = 'active'<br>
<strong>ALL</strong> = 'all'<br>
<strong>ALLOW_THREADS</strong> = 1<br>
<strong>ANCHOR</strong> = 'anchor'<br>
<strong>ARC</strong> = 'arc'<br>
<strong>BASELINE</strong> = 'baseline'<br>
<strong>BEVEL</strong> = 'bevel'<br>
<strong>BOTH</strong> = 'both'<br>
<strong>BOTTOM</strong> = 'bottom'<br>
<strong>BROWSE</strong> = 'browse'<br>
<strong>BUFSIZE</strong> = 8192<br>
<strong>BUTT</strong> = 'butt'<br>
<strong>CASCADE</strong> = 'cascade'<br>
<strong>CENTER</strong> = 'center'<br>
<strong>CHAR</strong> = 'char'<br>
<strong>CHECKBUTTON</strong> = 'checkbutton'<br>
<strong>CHORD</strong> = 'chord'<br>
<strong>CLIP</strong> = 0<br>
<strong>CMapSearchPath</strong> = []<br>
<strong>COMMAND</strong> = 'command'<br>
<strong>CURRENT</strong> = 'current'<br>
<strong>DAILY</strong> = 3<br>
<strong>DISABLED</strong> = 'disabled'<br>
<strong>DOTBOX</strong> = 'dotbox'<br>
<strong>E</strong> = 'e'<br>
<strong>END</strong> = 'end'<br>
<strong>ERR_CALL</strong> = 3<br>
<strong>ERR_DEFAULT</strong> = 521<br>
<strong>ERR_IGNORE</strong> = 0<br>
<strong>ERR_LOG</strong> = 5<br>
<strong>ERR_PRINT</strong> = 4<br>
<strong>ERR_RAISE</strong> = 2<br>
<strong>ERR_WARN</strong> = 1<br>
<strong>EW</strong> = 'ew'<br>
<strong>EXCEPTION</strong> = 8<br>
<strong>EXTENDED</strong> = 'extended'<br>
<strong>FALSE</strong> = 0<br>
<strong>FIRST</strong> = 'first'<br>
<strong>FLAT</strong> = 'flat'<br>
<strong>FLOATING_POINT_SUPPORT</strong> = 1<br>
<strong>FPE_DIVIDEBYZERO</strong> = 1<br>
<strong>FPE_INVALID</strong> = 8<br>
<strong>FPE_OVERFLOW</strong> = 2<br>
<strong>FPE_UNDERFLOW</strong> = 4<br>
<strong>FR</strong> = FR<br>
<strong>False_</strong> = False<br>
<strong>File_xls</strong> = &lt;xlrd.book.Book object&gt;<br>
<strong>GROOVE</strong> = 'groove'<br>
<strong>HIDDEN</strong> = 'hidden'<br>
<strong>HORIZONTAL</strong> = 'horizontal'<br>
<strong>HOURLY</strong> = 4<br>
<strong>INSERT</strong> = 'insert'<br>
<strong>INSIDE</strong> = 'inside'<br>
<strong>Inf</strong> = inf<br>
<strong>Infinity</strong> = inf<br>
<strong>Ipc_globaList</strong> = [100, 122.07207207207207, 150.6006006006006, 175.8258258258258, 211.86186186186183, 260.06006006006, 325.22522522522513, 419.81981981981966, 503.30330330330315, 561.8618618618617, 614.5645645645643, 676.2762762762761, 761.7117117117115, 865.7657657657657, 971.7717717717717, 1063.5135135135135, 1135.1351351351348, 1196.8468468468466, 1246.8468468468468, 1284.5345345345345, ...]<br>
<strong>LAST</strong> = 'last'<br>
<strong>LEFT</strong> = 'left'<br>
<strong>MAXDIMS</strong> = 32<br>
<strong>MINUTELY</strong> = 5<br>
<strong>MITER</strong> = 'miter'<br>
<strong>MO</strong> = MO<br>
<strong>MONTHLY</strong> = 1<br>
<strong>MOVETO</strong> = 'moveto'<br>
<strong>MULTIPLE</strong> = 'multiple'<br>
<strong>N</strong> = 'n'<br>
<strong>NAN</strong> = nan<br>
<strong>NE</strong> = 'ne'<br>
<strong>NINF</strong> = -inf<br>
<strong>NO</strong> = 0<br>
<strong>NONE</strong> = 'none'<br>
<strong>NORMAL</strong> = 'normal'<br>
<strong>NS</strong> = 'ns'<br>
<strong>NSEW</strong> = 'nsew'<br>
<strong>NUMERIC</strong> = 'numeric'<br>
<strong>NW</strong> = 'nw'<br>
<strong>NZERO</strong> = -0.0<br>
<strong>NaN</strong> = nan<br>
<strong>OFF</strong> = 0<br>
<strong>ON</strong> = 1<br>
<strong>OUTSIDE</strong> = 'outside'<br>
<strong>PAGES</strong> = 'pages'<br>
<strong>PIESLICE</strong> = 'pieslice'<br>
<strong>PINF</strong> = inf<br>
<strong>PROJECTING</strong> = 'projecting'<br>
<strong>PZERO</strong> = 0.0<br>
<strong>RADIOBUTTON</strong> = 'radiobutton'<br>
<strong>RAISE</strong> = 2<br>
<strong>RAISED</strong> = 'raised'<br>
<strong>READABLE</strong> = 2<br>
<strong>RIDGE</strong> = 'ridge'<br>
<strong>RIGHT</strong> = 'right'<br>
<strong>ROUND</strong> = 'round'<br>
<strong>ReportLabBlue</strong> = Color(0,.2,.498039,1)<br>
<strong>ReportLabBlueOLD</strong> = Color(.305882,.337255,.533333,1)<br>
<strong>ReportLabBluePCMYK</strong> = PCMYKColor(100,65,0,30,spotName='Pantone 288U',alpha=100)<br>
<strong>ReportLabFidBlue</strong> = Color(.2,.4,.8,1)<br>
<strong>ReportLabFidRed</strong> = Color(.8,0,.2,1)<br>
<strong>ReportLabGreen</strong> = Color(.2,.4,0,1)<br>
<strong>ReportLabLightBlue</strong> = Color(.717647,.72549,.827451,1)<br>
<strong>ReportLabLightGreen</strong> = Color(.2,.6,.2,1)<br>
<strong>S</strong> = 's'<br>
<strong>SA</strong> = SA<br>
<strong>SCROLL</strong> = 'scroll'<br>
<strong>SE</strong> = 'se'<br>
<strong>SECONDLY</strong> = 6<br>
<strong>SEL</strong> = 'sel'<br>
<strong>SEL_FIRST</strong> = 'sel.first'<br>
<strong>SEL_LAST</strong> = 'sel.last'<br>
<strong>SEPARATOR</strong> = 'separator'<br>
<strong>SHIFT_DIVIDEBYZERO</strong> = 0<br>
<strong>SHIFT_INVALID</strong> = 9<br>
<strong>SHIFT_OVERFLOW</strong> = 3<br>
<strong>SHIFT_UNDERFLOW</strong> = 6<br>
<strong>SINGLE</strong> = 'single'<br>
<strong>SOLID</strong> = 'solid'<br>
<strong>SU</strong> = SU<br>
<strong>SUNKEN</strong> = 'sunken'<br>
<strong>SW</strong> = 'sw'<br>
<strong>ScalarType</strong> = (&lt;type 'int'&gt;, &lt;type 'float'&gt;, &lt;type 'complex'&gt;, &lt;type 'long'&gt;, &lt;type 'bool'&gt;, &lt;type 'str'&gt;, &lt;type 'unicode'&gt;, &lt;type 'buffer'&gt;, &lt;type 'numpy.string_'&gt;, &lt;type 'numpy.int32'&gt;, &lt;type 'numpy.uint32'&gt;, &lt;type 'numpy.float64'&gt;, &lt;type 'numpy.complex128'&gt;, &lt;type 'numpy.unicode_'&gt;, &lt;type 'numpy.int32'&gt;, &lt;type 'numpy.uint32'&gt;, &lt;type 'numpy.float64'&gt;, &lt;type 'numpy.bool_'&gt;, &lt;type 'numpy.complex128'&gt;, &lt;type 'numpy.void'&gt;, ...)<br>
<strong>StringTypes</strong> = (&lt;type 'str'&gt;, &lt;type 'unicode'&gt;)<br>
<strong>T1SearchPath</strong> = [r'C:\Python27\lib\site-packages\reportlab-3.1.40-py2.7-win-amd64.egg\reportlab\fonts']<br>
<strong>TA_CENTER</strong> = 1<br>
<strong>TA_JUSTIFY</strong> = 4<br>
<strong>TA_LEFT</strong> = 0<br>
<strong>TA_RIGHT</strong> = 2<br>
<strong>TH</strong> = TH<br>
<strong>TOP</strong> = 'top'<br>
<strong>TRUE</strong> = 1<br>
<strong>TTFSearchPath</strong> = [r'c:\windows\fonts', r'C:\Python27\lib\site-packages\reportlab-3.1.40-py2.7-win-amd64.egg\reportlab\fonts']<br>
<strong>TU</strong> = TU<br>
<strong>TclVersion</strong> = 8.5<br>
<strong>TkVersion</strong> = 8.5<br>
<strong>True_</strong> = True<br>
<strong>UFUNC_BUFSIZE_DEFAULT</strong> = 8192<br>
<strong>UFUNC_PYVALS_NAME</strong> = 'UFUNC_PYVALS'<br>
<strong>UNDERLINE</strong> = 'underline'<br>
<strong>UNITS</strong> = 'units'<br>
<strong>VERTICAL</strong> = 'vertical'<br>
<strong>W</strong> = 'w'<br>
<strong>WE</strong> = WE<br>
<strong>WEEKLY</strong> = 2<br>
<strong>WORD</strong> = 'word'<br>
<strong>WRAP</strong> = 1<br>
<strong>WRITABLE</strong> = 4<br>
<strong>X</strong> = 'x'<br>
<strong>Y</strong> = 'y'<br>
<strong>YEARLY</strong> = 0<br>
<strong>YES</strong> = 1<br>
<strong>ZLIB_WARNINGS</strong> = 1<br>
<strong>__author__</strong> = 'Miguel Fialho, N<font color="#c040c0">\xc2\xba</font> 5958 - Pedro Serrano, N<font color="#c040c0">\xc2\xba</font> 3958'<br>
<strong>__copyright__</strong> = 'Copyright 2014 - Miguel Fialho / Pedro Serrano'<br>
<strong>__credits__</strong> = ''<br>
<strong>__email__</strong> = 'mF200_5@hotmail.com'<br>
<strong>__license__</strong> = 'GPL'<br>
<strong>__maintainer__</strong> = '1.0'<br>
<strong>__status__</strong> = ''<br>
<strong>absolute</strong> = &lt;ufunc 'absolute'&gt;<br>
<strong>absolute_import</strong> = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)<br>
<strong>add</strong> = &lt;ufunc 'add'&gt;<br>
<strong>aliceblue</strong> = Color(.941176,.972549,1,1)<br>
<strong>allowShortTableRows</strong> = 1<br>
<strong>allowTableBoundsErrors</strong> = 1<br>
<strong>anos</strong> = [1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, ...]<br>
<strong>antiquewhite</strong> = Color(.980392,.921569,.843137,1)<br>
<strong>aqua</strong> = Color(0,1,1,1)<br>
<strong>aquamarine</strong> = Color(.498039,1,.831373,1)<br>
<strong>arccos</strong> = &lt;ufunc 'arccos'&gt;<br>
<strong>arccosh</strong> = &lt;ufunc 'arccosh'&gt;<br>
<strong>arcsin</strong> = &lt;ufunc 'arcsin'&gt;<br>
<strong>arcsinh</strong> = &lt;ufunc 'arcsinh'&gt;<br>
<strong>arctan</strong> = &lt;ufunc 'arctan'&gt;<br>
<strong>arctan2</strong> = &lt;ufunc 'arctan2'&gt;<br>
<strong>arctanh</strong> = &lt;ufunc 'arctanh'&gt;<br>
<strong>autoConvertEncoding</strong> = 0<br>
<strong>azure</strong> = Color(.941176,1,1,1)<br>
<strong>baseUnderlineProportion</strong> = 0.0<br>
<strong>beige</strong> = Color(.960784,.960784,.862745,1)<br>
<strong>bisque</strong> = Color(1,.894118,.768627,1)<br>
<strong>bitwise_and</strong> = &lt;ufunc 'bitwise_and'&gt;<br>
<strong>bitwise_not</strong> = &lt;ufunc 'invert'&gt;<br>
<strong>bitwise_or</strong> = &lt;ufunc 'bitwise_or'&gt;<br>
<strong>bitwise_xor</strong> = &lt;ufunc 'bitwise_xor'&gt;<br>
<strong>black</strong> = Color(0,0,0,1)<br>
<strong>blanchedalmond</strong> = Color(1,.921569,.803922,1)<br>
<strong>blue</strong> = Color(0,0,1,1)<br>
<strong>blueviolet</strong> = Color(.541176,.168627,.886275,1)<br>
<strong>brown</strong> = Color(.647059,.164706,.164706,1)<br>
<strong>burlywood</strong> = Color(.870588,.721569,.529412,1)<br>
<strong>c_</strong> = &lt;numpy.lib.index_tricks.CClass object&gt;<br>
<strong>cadetblue</strong> = Color(.372549,.619608,.627451,1)<br>
<strong>canvas_baseColor</strong> = None<br>
<strong>canvas_basefontname</strong> = 'Helvetica'<br>
<strong>cast</strong> = {&lt;type 'numpy.string_'&gt;: &lt;function &lt;lambda&gt; at 0...x64'&gt;: &lt;function &lt;lambda&gt; at 0x0000000002D50748&gt;}<br>
<strong>ceil</strong> = &lt;ufunc 'ceil'&gt;<br>
<strong>chartreuse</strong> = Color(.498039,1,0,1)<br>
<strong>chocolate</strong> = Color(.823529,.411765,.117647,1)<br>
<strong>conj</strong> = &lt;ufunc 'conjugate'&gt;<br>
<strong>conjugate</strong> = &lt;ufunc 'conjugate'&gt;<br>
<strong>copysign</strong> = &lt;ufunc 'copysign'&gt;<br>
<strong>coral</strong> = Color(1,.498039,.313725,1)<br>
<strong>cornflower</strong> = Color(.392157,.584314,.929412,1)<br>
<strong>cornflowerblue</strong> = Color(.392157,.584314,.929412,1)<br>
<strong>cornsilk</strong> = Color(1,.972549,.862745,1)<br>
<strong>cos</strong> = &lt;ufunc 'cos'&gt;<br>
<strong>cosh</strong> = &lt;ufunc 'cosh'&gt;<br>
<strong>crimson</strong> = Color(.862745,.078431,.235294,1)<br>
<strong>cssParse</strong> = &lt;reportlab.lib.colors.cssParse instance&gt;<br>
<strong>cyan</strong> = Color(0,1,1,1)<br>
<strong>darkblue</strong> = Color(0,0,.545098,1)<br>
<strong>darkcyan</strong> = Color(0,.545098,.545098,1)<br>
<strong>darkgoldenrod</strong> = Color(.721569,.52549,.043137,1)<br>
<strong>darkgray</strong> = Color(.662745,.662745,.662745,1)<br>
<strong>darkgreen</strong> = Color(0,.392157,0,1)<br>
<strong>darkgrey</strong> = Color(.662745,.662745,.662745,1)<br>
<strong>darkkhaki</strong> = Color(.741176,.717647,.419608,1)<br>
<strong>darkmagenta</strong> = Color(.545098,0,.545098,1)<br>
<strong>darkolivegreen</strong> = Color(.333333,.419608,.184314,1)<br>
<strong>darkorange</strong> = Color(1,.54902,0,1)<br>
<strong>darkorchid</strong> = Color(.6,.196078,.8,1)<br>
<strong>darkred</strong> = Color(.545098,0,0,1)<br>
<strong>darksalmon</strong> = Color(.913725,.588235,.478431,1)<br>
<strong>darkseagreen</strong> = Color(.560784,.737255,.545098,1)<br>
<strong>darkslateblue</strong> = Color(.282353,.239216,.545098,1)<br>
<strong>darkslategray</strong> = Color(.184314,.309804,.309804,1)<br>
<strong>darkslategrey</strong> = Color(.184314,.309804,.309804,1)<br>
<strong>darkturquoise</strong> = Color(0,.807843,.819608,1)<br>
<strong>darkviolet</strong> = Color(.580392,0,.827451,1)<br>
<strong>debug</strong> = 0<br>
<strong>decimalSymbol</strong> = '.'<br>
<strong>deeppink</strong> = Color(1,.078431,.576471,1)<br>
<strong>deepskyblue</strong> = Color(0,.74902,1,1)<br>
<strong>defaultEncoding</strong> = 'WinAnsiEncoding'<br>
<strong>defaultGraphicsFontName</strong> = 'Times-Roman'<br>
<strong>defaultImageCaching</strong> = 0<br>
<strong>defaultPageSize</strong> = (595.275590551181, 841.8897637795275)<br>
<strong>deg2rad</strong> = &lt;ufunc 'deg2rad'&gt;<br>
<strong>degrees</strong> = &lt;ufunc 'degrees'&gt;<br>
<strong>dimgray</strong> = Color(.411765,.411765,.411765,1)<br>
<strong>dimgrey</strong> = Color(.411765,.411765,.411765,1)<br>
<strong>divide</strong> = &lt;ufunc 'divide'&gt;<br>
<strong>division</strong> = _Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)<br>
<strong>dodgerblue</strong> = Color(.117647,.564706,1,1)<br>
<strong>e</strong> = 2.718281828459045<br>
<strong>emptyTableAction</strong> = 'error'<br>
<strong>eps_preview</strong> = 1<br>
<strong>eps_preview_transparent</strong> = None<br>
<strong>eps_ttf_embed</strong> = 1<br>
<strong>eps_ttf_embed_uid</strong> = 0<br>
<strong>equal</strong> = &lt;ufunc 'equal'&gt;<br>
<strong>euler_gamma</strong> = 0.5772156649015329<br>
<strong>exp</strong> = &lt;ufunc 'exp'&gt;<br>
<strong>exp2</strong> = &lt;ufunc 'exp2'&gt;<br>
<strong>expm1</strong> = &lt;ufunc 'expm1'&gt;<br>
<strong>fabs</strong> = &lt;ufunc 'fabs'&gt;<br>
<strong>fidblue</strong> = Color(.2,.4,.8,1)<br>
<strong>fidlightblue</strong> = Color(.839216,.878431,.960784,1)<br>
<strong>fidred</strong> = Color(.8,0,.2,1)<br>
<strong>filename</strong> = 'IPC_Portugal_1977_2013.xls'<br>
<strong>firebrick</strong> = Color(.698039,.133333,.133333,1)<br>
<strong>floor</strong> = &lt;ufunc 'floor'&gt;<br>
<strong>floor_divide</strong> = &lt;ufunc 'floor_divide'&gt;<br>
<strong>floralwhite</strong> = Color(1,.980392,.941176,1)<br>
<strong>fmax</strong> = &lt;ufunc 'fmax'&gt;<br>
<strong>fmin</strong> = &lt;ufunc 'fmin'&gt;<br>
<strong>fmod</strong> = &lt;ufunc 'fmod'&gt;<br>
<strong>forestgreen</strong> = Color(.133333,.545098,.133333,1)<br>
<strong>frexp</strong> = &lt;ufunc 'frexp'&gt;<br>
<strong>fsEncodings</strong> = ('utf8', 'cp1252', 'cp430')<br>
<strong>fuchsia</strong> = Color(1,0,1,1)<br>
<strong>gainsboro</strong> = Color(.862745,.862745,.862745,1)<br>
<strong>ghostwhite</strong> = Color(.972549,.972549,1,1)<br>
<strong>gold</strong> = Color(1,.843137,0,1)<br>
<strong>goldenrod</strong> = Color(.854902,.647059,.12549,1)<br>
<strong>greater</strong> = &lt;ufunc 'greater'&gt;<br>
<strong>greater_equal</strong> = &lt;ufunc 'greater_equal'&gt;<br>
<strong>green</strong> = Color(0,.501961,0,1)<br>
<strong>greenyellow</strong> = Color(.678431,1,.184314,1)<br>
<strong>grey</strong> = Color(.501961,.501961,.501961,1)<br>
<strong>honeydew</strong> = Color(.941176,1,.941176,1)<br>
<strong>hotpink</strong> = Color(1,.411765,.705882,1)<br>
<strong>hypot</strong> = &lt;ufunc 'hypot'&gt;<br>
<strong>i</strong> = 1936.3004988855255<br>
<strong>ignoreContainerActions</strong> = 1<br>
<strong>imageReaderFlags</strong> = 0<br>
<strong>inch</strong> = 72.0<br>
<strong>index_exp</strong> = &lt;numpy.lib.index_tricks.IndexExpression object&gt;<br>
<strong>indianred</strong> = Color(.803922,.360784,.360784,1)<br>
<strong>indigo</strong> = Color(.294118,0,.509804,1)<br>
<strong>inf</strong> = inf<br>
<strong>infty</strong> = inf<br>
<strong>inscritosIn</strong> = [100, 122, 150, 175, 211, 260, 325, 419, 503, 561, 614, 676, 761, 865, 971, 1063, 1135, 1196, 1246, 1284, ...]<br>
<strong>inscritosInt</strong> = [100, 122.07207207207207, 150.6006006006006, 175.8258258258258, 211.86186186186183, 260.06006006006, 325.22522522522513, 419.81981981981966, 503.30330330330315, 561.8618618618617, 614.5645645645643, 676.2762762762761, 761.7117117117115, 865.7657657657657, 971.7717717717717, 1063.5135135135135, 1135.1351351351348, 1196.8468468468466, 1246.8468468468468, 1284.5345345345345, ...]<br>
<strong>invariant</strong> = 0<br>
<strong>invert</strong> = &lt;ufunc 'invert'&gt;<br>
<strong>isPy3</strong> = False<br>
<strong>isfinite</strong> = &lt;ufunc 'isfinite'&gt;<br>
<strong>isinf</strong> = &lt;ufunc 'isinf'&gt;<br>
<strong>isnan</strong> = &lt;ufunc 'isnan'&gt;<br>
<strong>ivory</strong> = Color(1,1,.941176,1)<br>
<strong>khaki</strong> = Color(.941176,.901961,.54902,1)<br>
<strong>label_Anos</strong> = 'Ano Transacto'<br>
<strong>label_IPC</strong> = '<font color="#c040c0">\xc3\x8d</font>ndice de Pre<font color="#c040c0">\xc3\xa7</font>os ao Consumidor'<br>
<strong>lavender</strong> = Color(.901961,.901961,.980392,1)<br>
<strong>lavenderblush</strong> = Color(1,.941176,.960784,1)<br>
<strong>lawngreen</strong> = Color(.486275,.988235,0,1)<br>
<strong>ldexp</strong> = &lt;ufunc 'ldexp'&gt;<br>
<strong>left_shift</strong> = &lt;ufunc 'left_shift'&gt;<br>
<strong>lemonchiffon</strong> = Color(1,.980392,.803922,1)<br>
<strong>less</strong> = &lt;ufunc 'less'&gt;<br>
<strong>less_equal</strong> = &lt;ufunc 'less_equal'&gt;<br>
<strong>letter</strong> = (612.0, 792.0)<br>
<strong>lightblue</strong> = Color(.678431,.847059,.901961,1)<br>
<strong>lightcoral</strong> = Color(.941176,.501961,.501961,1)<br>
<strong>lightcyan</strong> = Color(.878431,1,1,1)<br>
<strong>lightgoldenrodyellow</strong> = Color(.980392,.980392,.823529,1)<br>
<strong>lightgreen</strong> = Color(.564706,.933333,.564706,1)<br>
<strong>lightgrey</strong> = Color(.827451,.827451,.827451,1)<br>
<strong>lightpink</strong> = Color(1,.713725,.756863,1)<br>
<strong>lightsalmon</strong> = Color(1,.627451,.478431,1)<br>
<strong>lightseagreen</strong> = Color(.12549,.698039,.666667,1)<br>
<strong>lightskyblue</strong> = Color(.529412,.807843,.980392,1)<br>
<strong>lightslategray</strong> = Color(.466667,.533333,.6,1)<br>
<strong>lightslategrey</strong> = Color(.466667,.533333,.6,1)<br>
<strong>lightsteelblue</strong> = Color(.690196,.768627,.870588,1)<br>
<strong>lightyellow</strong> = Color(1,1,.878431,1)<br>
<strong>lime</strong> = Color(0,1,0,1)<br>
<strong>limegreen</strong> = Color(.196078,.803922,.196078,1)<br>
<strong>linen</strong> = Color(.980392,.941176,.901961,1)<br>
<strong>listWrapOnFakeWidth</strong> = 1<br>
<strong>little_endian</strong> = True<br>
<strong>log</strong> = &lt;ufunc 'log'&gt;<br>
<strong>log10</strong> = &lt;ufunc 'log10'&gt;<br>
<strong>log1p</strong> = &lt;ufunc 'log1p'&gt;<br>
<strong>log2</strong> = &lt;ufunc 'log2'&gt;<br>
<strong>logaddexp</strong> = &lt;ufunc 'logaddexp'&gt;<br>
<strong>logaddexp2</strong> = &lt;ufunc 'logaddexp2'&gt;<br>
<strong>logical_and</strong> = &lt;ufunc 'logical_and'&gt;<br>
<strong>logical_not</strong> = &lt;ufunc 'logical_not'&gt;<br>
<strong>logical_or</strong> = &lt;ufunc 'logical_or'&gt;<br>
<strong>logical_xor</strong> = &lt;ufunc 'logical_xor'&gt;<br>
<strong>longTableOptimize</strong> = 1<br>
<strong>magenta</strong> = Color(1,0,1,1)<br>
<strong>maroon</strong> = Color(.501961,0,0,1)<br>
<strong>maximum</strong> = &lt;ufunc 'maximum'&gt;<br>
<strong>mediumaquamarine</strong> = Color(.4,.803922,.666667,1)<br>
<strong>mediumblue</strong> = Color(0,0,.803922,1)<br>
<strong>mediumorchid</strong> = Color(.729412,.333333,.827451,1)<br>
<strong>mediumpurple</strong> = Color(.576471,.439216,.858824,1)<br>
<strong>mediumseagreen</strong> = Color(.235294,.701961,.443137,1)<br>
<strong>mediumslateblue</strong> = Color(.482353,.407843,.933333,1)<br>
<strong>mediumspringgreen</strong> = Color(0,.980392,.603922,1)<br>
<strong>mediumturquoise</strong> = Color(.282353,.819608,.8,1)<br>
<strong>mediumvioletred</strong> = Color(.780392,.082353,.521569,1)<br>
<strong>mgrid</strong> = &lt;numpy.lib.index_tricks.nd_grid object&gt;<br>
<strong>midnightblue</strong> = Color(.098039,.098039,.439216,1)<br>
<strong>minimum</strong> = &lt;ufunc 'minimum'&gt;<br>
<strong>mintcream</strong> = Color(.960784,1,.980392,1)<br>
<strong>mistyrose</strong> = Color(1,.894118,.882353,1)<br>
<strong>mm</strong> = 2.834645669291339<br>
<strong>moccasin</strong> = Color(1,.894118,.709804,1)<br>
<strong>mod</strong> = &lt;ufunc 'remainder'&gt;<br>
<strong>modf</strong> = &lt;ufunc 'modf'&gt;<br>
<strong>multiply</strong> = &lt;ufunc 'multiply'&gt;<br>
<strong>nan</strong> = nan<br>
<strong>navajowhite</strong> = Color(1,.870588,.678431,1)<br>
<strong>navy</strong> = Color(0,0,.501961,1)<br>
<strong>nbytes</strong> = {&lt;type 'numpy.string_'&gt;: 0, &lt;type 'numpy.int32'&gt;...'numpy.float32'&gt;: 4, &lt;type 'numpy.complex64'&gt;: 8}<br>
<strong>negative</strong> = &lt;ufunc 'negative'&gt;<br>
<strong>newaxis</strong> = None<br>
<strong>nextafter</strong> = &lt;ufunc 'nextafter'&gt;<br>
<strong>not_equal</strong> = &lt;ufunc 'not_equal'&gt;<br>
<strong>odbc_driver</strong> = 'odbc'<br>
<strong>ogrid</strong> = &lt;numpy.lib.index_tricks.nd_grid object&gt;<br>
<strong>oldlace</strong> = Color(.992157,.960784,.901961,1)<br>
<strong>olive</strong> = Color(.501961,.501961,0,1)<br>
<strong>olivedrab</strong> = Color(.419608,.556863,.137255,1)<br>
<strong>orange</strong> = Color(1,.647059,0,1)<br>
<strong>orangered</strong> = Color(1,.270588,0,1)<br>
<strong>orchid</strong> = Color(.854902,.439216,.839216,1)<br>
<strong>overlapAttachedSpace</strong> = 1<br>
<strong>pageCompression</strong> = 1<br>
<strong>palegoldenrod</strong> = Color(.933333,.909804,.666667,1)<br>
<strong>palegreen</strong> = Color(.596078,.984314,.596078,1)<br>
<strong>paleturquoise</strong> = Color(.686275,.933333,.933333,1)<br>
<strong>palevioletred</strong> = Color(.858824,.439216,.576471,1)<br>
<strong>papayawhip</strong> = Color(1,.937255,.835294,1)<br>
<strong>paraFontSizeHeightOffset</strong> = 1<br>
<strong>pdfComments</strong> = 0<br>
<strong>pdfMultiLine</strong> = 0<br>
<strong>peachpuff</strong> = Color(1,.854902,.72549,1)<br>
<strong>peru</strong> = Color(.803922,.521569,.247059,1)<br>
<strong>pi</strong> = 3.141592653589793<br>
<strong>platypus_link_underline</strong> = 0<br>
<strong>plum</strong> = Color(.866667,.627451,.866667,1)<br>
<strong>powderblue</strong> = Color(.690196,.878431,.901961,1)<br>
<strong>print_function</strong> = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)<br>
<strong>purple</strong> = Color(.501961,0,.501961,1)<br>
<strong>r_</strong> = &lt;numpy.lib.index_tricks.RClass object&gt;<br>
<strong>rad2deg</strong> = &lt;ufunc 'rad2deg'&gt;<br>
<strong>radians</strong> = &lt;ufunc 'radians'&gt;<br>
<strong>rcParams</strong> = RcParams({u'agg.path.chunksize': 0,
          u'...r.size': 2,
          u'ytick.minor.width': 0.5})<br>
<strong>rcParamsDefault</strong> = RcParams({u'agg.path.chunksize': 0,
          u'...r.size': 2,
          u'ytick.minor.width': 0.5})<br>
<strong>reciprocal</strong> = &lt;ufunc 'reciprocal'&gt;<br>
<strong>red</strong> = Color(1,0,0,1)<br>
<strong>remainder</strong> = &lt;ufunc 'remainder'&gt;<br>
<strong>results1</strong> = [100, 122, 150, 175, 211, 260, 325, 419, 503, 561, 614, 676, 761, 865, 971, 1063, 1135, 1196, 1246, 1284, ...]<br>
<strong>results2</strong> = [1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, ...]<br>
<strong>right_shift</strong> = &lt;ufunc 'right_shift'&gt;<br>
<strong>rint</strong> = &lt;ufunc 'rint'&gt;<br>
<strong>rosybrown</strong> = Color(.737255,.560784,.560784,1)<br>
<strong>royalblue</strong> = Color(.254902,.411765,.882353,1)<br>
<strong>rtlSupport</strong> = 0<br>
<strong>s_</strong> = &lt;numpy.lib.index_tricks.IndexExpression object&gt;<br>
<strong>saddlebrown</strong> = Color(.545098,.270588,.07451,1)<br>
<strong>salmon</strong> = Color(.980392,.501961,.447059,1)<br>
<strong>sandybrown</strong> = Color(.956863,.643137,.376471,1)<br>
<strong>sctypeDict</strong> = {0: &lt;type 'numpy.bool_'&gt;, 1: &lt;type 'numpy.int8'&gt;, 2: &lt;type 'numpy.uint8'&gt;, 3: &lt;type 'numpy.int16'&gt;, 4: &lt;type 'numpy.uint16'&gt;, 5: &lt;type 'numpy.int32'&gt;, 6: &lt;type 'numpy.uint32'&gt;, 7: &lt;type 'numpy.int32'&gt;, 8: &lt;type 'numpy.uint32'&gt;, 9: &lt;type 'numpy.int64'&gt;, ...}<br>
<strong>sctypeNA</strong> = {'?': 'Bool', 'B': 'UInt8', 'Bool': &lt;type 'numpy.bool_'&gt;, 'Complex32': &lt;type 'numpy.complex64'&gt;, 'Complex64': &lt;type 'numpy.complex128'&gt;, 'D': 'Complex64', 'Datetime64': &lt;type 'numpy.datetime64'&gt;, 'F': 'Complex32', 'Float16': &lt;type 'numpy.float16'&gt;, 'Float32': &lt;type 'numpy.float32'&gt;, ...}<br>
<strong>sctypes</strong> = {'complex': [&lt;type 'numpy.complex64'&gt;, &lt;type 'numpy.complex128'&gt;], 'float': [&lt;type 'numpy.float16'&gt;, &lt;type 'numpy.float32'&gt;, &lt;type 'numpy.float64'&gt;], 'int': [&lt;type 'numpy.int8'&gt;, &lt;type 'numpy.int16'&gt;, &lt;type 'numpy.int32'&gt;, &lt;type 'numpy.int64'&gt;], 'others': [&lt;type 'bool'&gt;, &lt;type 'object'&gt;, &lt;type 'str'&gt;, &lt;type 'unicode'&gt;, &lt;type 'numpy.void'&gt;], 'uint': [&lt;type 'numpy.uint8'&gt;, &lt;type 'numpy.uint16'&gt;, &lt;type 'numpy.uint32'&gt;, &lt;type 'numpy.uint64'&gt;]}<br>
<strong>seagreen</strong> = Color(.180392,.545098,.341176,1)<br>
<strong>seashell</strong> = Color(1,.960784,.933333,1)<br>
<strong>shapeChecking</strong> = 1<br>
<strong>sheet</strong> = &lt;xlrd.sheet.Sheet object&gt;<br>
<strong>showBoundary</strong> = 0<br>
<strong>sienna</strong> = Color(.627451,.321569,.176471,1)<br>
<strong>sign</strong> = &lt;ufunc 'sign'&gt;<br>
<strong>signbit</strong> = &lt;ufunc 'signbit'&gt;<br>
<strong>silver</strong> = Color(.752941,.752941,.752941,1)<br>
<strong>sin</strong> = &lt;ufunc 'sin'&gt;<br>
<strong>sinh</strong> = &lt;ufunc 'sinh'&gt;<br>
<strong>skyblue</strong> = Color(.529412,.807843,.921569,1)<br>
<strong>slateblue</strong> = Color(.415686,.352941,.803922,1)<br>
<strong>slategray</strong> = Color(.439216,.501961,.564706,1)<br>
<strong>slategrey</strong> = Color(.439216,.501961,.564706,1)<br>
<strong>snow</strong> = Color(1,.980392,.980392,1)<br>
<strong>spacing</strong> = &lt;ufunc 'spacing'&gt;<br>
<strong>springgreen</strong> = Color(0,1,.498039,1)<br>
<strong>sqrt</strong> = &lt;ufunc 'sqrt'&gt;<br>
<strong>square</strong> = &lt;ufunc 'square'&gt;<br>
<strong>steelblue</strong> = Color(.27451,.509804,.705882,1)<br>
<strong>subtract</strong> = &lt;ufunc 'subtract'&gt;<br>
<strong>tan</strong> = &lt;ufunc 'tan'&gt;<br>
<strong>tanh</strong> = &lt;ufunc 'tanh'&gt;<br>
<strong>teal</strong> = Color(0,.501961,.501961,1)<br>
<strong>thistle</strong> = Color(.847059,.74902,.847059,1)<br>
<strong>toColor</strong> = &lt;reportlab.lib.colors.toColor instance&gt;<br>
<strong>tomato</strong> = Color(1,.388235,.278431,1)<br>
<strong>transparent</strong> = Color(0,0,0,0)<br>
<strong>true_divide</strong> = &lt;ufunc 'true_divide'&gt;<br>
<strong>trunc</strong> = &lt;ufunc 'trunc'&gt;<br>
<strong>ttfAsciiReadable</strong> = 1<br>
<strong>turquoise</strong> = Color(.25098,.878431,.815686,1)<br>
<strong>typeDict</strong> = {0: &lt;type 'numpy.bool_'&gt;, 1: &lt;type 'numpy.int8'&gt;, 2: &lt;type 'numpy.uint8'&gt;, 3: &lt;type 'numpy.int16'&gt;, 4: &lt;type 'numpy.uint16'&gt;, 5: &lt;type 'numpy.int32'&gt;, 6: &lt;type 'numpy.uint32'&gt;, 7: &lt;type 'numpy.int32'&gt;, 8: &lt;type 'numpy.uint32'&gt;, 9: &lt;type 'numpy.int64'&gt;, ...}<br>
<strong>typeNA</strong> = {'?': 'Bool', 'B': 'UInt8', 'Bool': &lt;type 'numpy.bool_'&gt;, 'Complex32': &lt;type 'numpy.complex64'&gt;, 'Complex64': &lt;type 'numpy.complex128'&gt;, 'D': 'Complex64', 'Datetime64': &lt;type 'numpy.datetime64'&gt;, 'F': 'Complex32', 'Float16': &lt;type 'numpy.float16'&gt;, 'Float32': &lt;type 'numpy.float32'&gt;, ...}<br>
<strong>typecodes</strong> = {'All': '?bhilqpBHILQPefdgFDGSUVOMm', 'AllFloat': 'efdgFDG', 'AllInteger': 'bBhHiIlLqQpP', 'Character': 'c', 'Complex': 'FDG', 'Datetime': 'Mm', 'Float': 'efdg', 'Integer': 'bhilqp', 'UnsignedInteger': 'BHILQP'}<br>
<strong>unicode_literals</strong> = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 131072)<br>
<strong>useA85</strong> = 1<br>
<strong>verbose</strong> = 0<br>
<strong>violet</strong> = Color(.933333,.509804,.933333,1)<br>
<strong>wantobjects</strong> = 1<br>
<strong>warnOnMissingFontGlyphs</strong> = 0<br>
<strong>wheat</strong> = Color(.960784,.870588,.701961,1)<br>
<strong>white</strong> = Color(1,1,1,1)<br>
<strong>whitesmoke</strong> = Color(.960784,.960784,.960784,1)<br>
<strong>wrapA85</strong> = 0<br>
<strong>yellow</strong> = Color(1,1,0,1)<br>
<strong>yellowgreen</strong> = Color(.603922,.803922,.196078,1)</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%">Miguel&nbsp;Fialho,&nbsp;Nº&nbsp;5958&nbsp;-&nbsp;Pedro&nbsp;Serrano,&nbsp;Nº&nbsp;3958</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Credits</strong></big></font></td></tr>
    
<tr><td bgcolor="#7799ee"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
<td width="100%"></td></tr></table>
</body></html>